Programming :: Testing Interactive Shell $- $PS1

Mar 22, 2010

I'm writing a bash script that can be run by crontab or by a user interactively.

If the script is run by a user interactively, it will ask for a parameter interactively.

If the script is run by the crontab, it validates if a command line parameter is provided.

In doing so, I cannot get these tests to work inside the bash script

Code:

This shell is not interactive

How the tests be done inside a script?

View 5 Replies


ADVERTISEMENT

Programming :: How To Turn Non-interactive Shell Into Interactive Shell?

Feb 4, 2011

I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

View 2 Replies View Related

Programming :: Run Interactive Commands From A Shell Script?

Aug 24, 2010

i need to run a command from a shell script that requires me to answer "Yes" to 2 questions that the command asks before it kicks off. how do i do this? i thought it was something like this.. from inside the parent script:

sh test.sh << "EOF
Yes
Yes

[code]...

View 3 Replies View Related

Programming :: BASH Shell Differences: Login Or Interactive

Feb 18, 2011

Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.It this true? Why is there more than one type of shell anyways? You can change users with the interactive shell, why not log on with it to?

View 10 Replies View Related

General :: Making Sh Shell Interactive?

Mar 24, 2011

how can I make my sh interactive by default. That I don't have to always type --interactive everytime I log in. I want it to be always interactive. #2- how also do I turn of --posix mode parmanently ? Is there a line I need to drop somewhere or what do i do.

View 4 Replies View Related

Red Hat / Fedora :: Remove User's Rights From Accessing The Interactive Shell?

May 11, 2010

What is it? How do I remove a user's rights from accessing the interactive shell?

View 1 Replies View Related

Debian Multimedia :: Skype Starting Every Time When Open Interactive Root Shell

Jan 20, 2015

I recently "upgraded" to the latest skype and now every time I open an interactive root shell, up pops skype. I can close skype then control-C in the terminal window to get the shell I want, but this is annoying to say the least. Maybe my google-foo is off, but all I can find is articles on how to run skype as root, which is no use. I've tried searching the startup files for "skype" (case independant), but so far all I can find is "LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu/ /usr/bin/skype" in the root .bashrc which shouldn't be starting the app.

what could be causing this?

(Running Wheezy)

View 2 Replies View Related

Server :: Testing Scripts From Shell?

Jan 18, 2011

How can I test a script that's written to receive arguments from an html form, from the shell?

View 6 Replies View Related

Ubuntu Security :: Testing Shell Codes In 10.10

Feb 9, 2011

I am learning exploit development and learning some stuff about shellcodes now! The shellcode is absolutely right and have tested it. I am using the following code...(created by me) to run my shellcode..

Code:
// #include<stdio.h> we will not be needing this as we are not using any functions from the C library...Just basic logic of Pointers..
char shellcode[] = "x31xc0xb0x01x31xdbxb3x07xcdx80"; // basic exit shellcode
int main()
{ int *ret; // a simple integer pointer pointing a address
ret = (int *)&ret + 2; // change the address pointed by
(*ret) = (int)shellcode; }

Compiling :-
Code:
aneesh@aneesh-laptop:~/articles/C$ gcc test.c -o test -fno-stack-protector
Compiling gives no errors as expected..

Now the problem I am facing is that As I run the program :-
Code:
aneesh@aneesh-laptop:~/articles/C$ ./test
Segmentation fault

Strace output :-
Code:
aneesh@aneesh-laptop:~/articles/C$ strace ./test
execve("./test", ["./test"], [/* 37 vars */]) = 0 .....
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78016c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xf5e000, 8192, PROT_READ) = 0
mprotect(0x8049000, 4096, PROT_READ) = 0
mprotect(0x15c000, 4096, PROT_READ) = 0
munmap(0xb7802000, 81274) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

I have some feeling that its because the program has no access to the memory containing the shellcode (May be???)..

View 2 Replies View Related

General :: Shell Script For Testing Connectivity Via URL?

Aug 5, 2010

I have comma separated file containing 3 fields:

Name,Shortcode,URL
Example of file is
Sony,52525,http://17.0.0.1/xyz
NDTV,53636,http://10.0.0.1/abc

Now i want to test every URL connectivity from my server by executing it using shell script and if url gives back response it shows output as "OK" in green color and if url is not responding it shows "NOT CONNECTED" in red color.

Output will be like following:

Sony 52525 OK
NDTV 53636 NOT CONNECTED

View 2 Replies View Related

Programming :: Make A Cronjob Or At Job User Interactive?

Sep 2, 2010

Any pointers to make a shell script in cronjob or using at to be user interactive. We have a requirement to script a program where it prompts the users in CUI for feedback and capture the output in a text file and act based on the feedback.For eg: At pre-defined time i should prompt the acitve users whether it is ok to shutdown, whose feedback would be captured in a text file. Post which act on the updates in the text file

View 4 Replies View Related

Programming :: Script Wich Will Act As And Interactive Front End To An Emailer?

Apr 6, 2009

Code:-ask the user which files they want to sent (files not needed to be in the same directore-tar all the files together-Gzip the tarfile-Uuencode the gsipped file (so more email programs can use it)-ask user who to send email to, possibly more than one person-I want it to be clear and easy to use and display what it is doing while an action is taken place.I have no clue where to begin. I think perl would be the best option, but I am not sure, how would I make this able to run with am email program and I am unaware how to tar and gzip files or Uuencode the gsipped files.

View 3 Replies View Related

Software :: Interactive Ruby Shell - Irb - Have Ruby But No Irb?

Oct 22, 2010

There are a few things not working properly. Ruby version manager seems ok but untill i get working with ruby i don't know if it is working properly. One thing that is not there is irb Interactive ruby is not available according the the message i get.

Well i have no idea what readline is but i did everything that is on that webpage referance page [url]. I have got a lot of progress and learned heaps about linux shell and bash terminal. The thing is i need to get this going and have tried feenode but it is very foreign and how it works i do not have a clue. I have got 2 things resolved so far through this forum but using other threads in it. i need to get irb going before i can progress to using ruby on Rails properly.

I am using a Eeepc running ubuntu easy peasy its version 9.04 of ubuntu. I need the whole of rails to work and want to get a handle on using ruby version manager along with the apache stack with mysql/phpmyadmin and am using this as a dummy run for setting up a development system.

View 2 Replies View Related

Programming :: Launching Interactive Gnome-terminal With A Command (and Not Exiting)

Oct 13, 2010

I want to have a script (tcsh/bash/python) that launches a bunch of gnome-terminals (or 1 with multiple tabs). And I want it to execute a command, but keep the shell interactive. Currently, if you type gnome-terminal then it launches a new interactive shell, but if you give it the execute flag, then it executes the command and quits (or stays open, but non-interactive depending on the users gnome-terminal settings).

I have this command which I want to run automatically before I start working. What the command does is dynamic and different for each shell. It takes arguments. So it's not something I can take care of in a .cshrc type file.

View 3 Replies View Related

Programming :: Write A Perl Script Which Will Give An Interactive Session To A User To Execute Command On The Server

Feb 25, 2011

I am trying to write a perl script which will give an interactive session to a user to execute command on the server. I have written a small script to do this :

Code: !/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $host = '192.168.1.1';
my $username = 'user';
my $login_passwd = 'test123';

[Code]...

View 2 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

Programming :: Toolkits To Do Automated GUI Testing?

May 13, 2010

I am involved in a project where some regression tests are to be automated. Could you please tell me what are the testing tools that are available for doing automated GUI testing in Linux?

View 2 Replies View Related

Programming :: Volunteer Needed For Security Testing

Sep 4, 2010

I need a person to look over and test the security of a program that I am writing. It is in its final stages so no major bugs should be in it. You have to be good in C programming, and know how encryption works. Being knowledgeable in security is a plus. Email me at <removed> or message in post if you are interested.

View 4 Replies View Related

Programming :: Tools Used For Testing Performance Of C And C++ Programs

Nov 17, 2008

I would like to know the Tools which are used for Testing the performance of C and C++ programs under linux?

View 4 Replies View Related

Debian Programming :: Building Gtk-sharp2 Binaries On Testing

Nov 20, 2014

I am trying to build architecture specific binaries of gtk-sharp2. So far I have been unable to get gtk-sharp2 to build even without specifying a specific architecture. I got the source with apt-get source gtk-sharp2 and attempted ./configure, make, but it fails to build with the error message:

Code: Select allNo rule to make target 'thread.c', needed by 'thread.lo'.

I've also tried downloading the source directly from the mono project [URL] ...., but when building it fails with

Code: Select all#error "Only <glib.h> can be included directly."

This site [URL] .... provides a patch to fix the error, but when I applied it I got the same error.

I think the Debian version applied the patch correctly, but for some reason I still get that other error message.

These message outputted by configure may point to the problem:

"checking if gcc supports -fno-rtti -fno-exceptions... no"
"./configure: line 12920: enable_msi: command not found"

View 2 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Programming :: C: Testing Multiple Consecutive Array Values Concurrently.?

Nov 22, 2010

Basically, I am provided with a file "temp.dat" with 30 high temperatures (integers) in it. The program is supposed to read them in and compute/print the average. Then it is supposed to print the temperature of each day and, in addition, display a + by each day that is over the average, but only if it is above the average high for three or more consecutive days. This is the part I am stuck on. I'd appreciate any tips that would point me in the right directionFull disclosure: This is a school project. Code:

Code:
#include <stdio.h>
#include <stdlib.h>

[code]....

View 2 Replies View Related

Programming :: Coverage Testing With Gcov - Terminal Not Accepting Copy Paste?

Jun 1, 2010

I have this treacherous program in C which uses external static libraries (extern etc), and want to do a coverage test of it. The libraries are written in fortran. I compile like this Code: gcc -fprofile-arcs -ftest-coverage -o main main.c library.o I run my nice program like that

Code: ./main Then I do the magic stuff
Code: gcov main.c library.f

Ok 98% of the lines were used in main.c, and I get a file with line counts and all that. Great! But, I need to know the coverage in my library too! It says 0.0% and that's impossible. So what can I do? I can't run it like an executable because it's a library.

And why is the terminal not accepting my copy paste? I copy some lines from my IDE, then I want to paste it into the terminal (with ctrl-v of course, not some crazy local application non-standard counter-intuitive key combo made just to cause agony among honest users!), and that could've been the only problem here, but it isn't. I can't even paste with that right click menu. So, if I was crazy before, I went nuts after that. My great "solution" was to paste it into the firefox URL field (not the search field ) and then copy that and paste it into the terminal. Is that common practice for you all while dealing with that unburied DOS-window?

View 1 Replies View Related

Programming :: BASH Script Optimization For Testing Large Number Of Files

Sep 18, 2010

I want to move files from a $SOURCEDIR to a $DESTBASE/$DESTDIR. Under $DESTBASE there are many directories, and I need to test beforehand if a file from $SOURCEDIR already exists in any of them.

This is obviously extremely slow, and the real use case involves dozens of dirs and thousands of files. Creating a temporary "index" file for the find command (instead of running it every iteration) speeds it up a little, but it's still very clumsy.

View 14 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Programming :: Possible To Assist In Programming Shell Scripts?

May 17, 2010

Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other

View 1 Replies View Related

Programming :: Shell Script To Tee ITSELF

Dec 10, 2008

I have a shell script that I would like to log to stdout and also to a file.....much like using tee. I would like to, instead of calling the script and piping to tee...i would like for the script to tee itself.

View 4 Replies View Related

Programming :: How To Create Own C Shell

Jul 11, 2010

i got to build my own linux shell for my project

View 5 Replies View Related

Programming :: Can Awk Take A Shell Variable

Jul 23, 2010

I have been searching most of today and am stuck on getting a variable into an awk portion of my bash script. I have this working:

Code:

#!/bin/sh
SRC=/var/log/mail.log
DEST=/var/www/output/myFile.txt
VAR=userName@myDomain.tld

[code]....

Can awk take a shell variable? Or do I have to do something completely different?

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved