![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script is taking more than 3 hrs to execute | nvuradi | Shell Programming and Scripting | 2 | 11-18-2007 11:02 PM |
| Wrap Interactive Script | meskue | Shell Programming and Scripting | 0 | 06-23-2006 06:21 PM |
| script to performm interactive ftp | prash_b | SUN Solaris | 1 | 05-09-2006 08:21 AM |
| Giveing input for BACKGROUND process | g_s_r_c | Shell Programming and Scripting | 2 | 09-06-2004 12:14 PM |
| Capture output from interactive script | MizzGail | Shell Programming and Scripting | 6 | 04-04-2002 05:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
put an interactive script in background after taking input
i am trying to find a way to put an interactive script in the background after taking input from the user
a few test lines i was trying: date echo "Enter location" LOCATION= read LOCATION sleep 100 sleep 200 date for this small example i want the script to as the user for the location. once the location is supplied then it should execute the subsequent commands in the script in the background and return control of the tesrminal to the user. i am a newbie to shell scripting. please help. |
|
||||
|
Quote:
next: bg<enter> |
|
||||
|
thanks to all.
System Shock -- & doesnt work as when i supply the location it gives an error "Execute permission denied", in other words it doesnt read it as the input to the script but a separate command itself joeyg -- your idea makes sense. but i was looking for something like a single script way of achieving this. sb008 -- your idea needs manual intervention. i am giving this to a few non-tech folks who will input what they have to. i cant expect them to find the pid and put it in bg, hence the question. really appreciate you guys taking time to answer. |
|
|||||
|
Quote:
Say you touch a file in /tmp named hello, then you take a file name, pass it to a find command, and put that find command in the background... Code:
# touch /tmp/hello # cat script echo "Enter file name" read FILE find / -name $FILE & Another way of doing it, would be to take the input on the command line, rather than a read command, then you can just put the whole thing in the background, like: Code:
# cat script LOCATION=$1 # ./script Arizona & |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|