Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Send job to Background after input redirection Post 302704361 by grep_me on Friday 21st of September 2012 12:41:39 PM
Old 09-21-2012
Send job to Background after input redirection

Hi,
I am having issues with syntax when I am trying to send a job to the background after a input redirection.
I have this script which sends some files to different servers after zipping them. Once I execute it, it will ask for user input as of which server the files need to go to. (The filenames and location are coded for in the script)
The script comes out of the execution if no input is passed within 5 secs.

Code:
send_files.ksh <enter> 
Choose destination ->
                     etl1
                     etl2
                     etl3
                     etl4
                     ALL #to send to All servers

I execute this script using the following:
Code:
send_files.ksh > $LOG/Sep21.log 2>&1 <<EOF
 ALL
 EOF

By doing that, the script waits at prompt until it finishes execution.
For it to not wait until execution completes I was trying to submit this job in the background but i am not able to figure out a syntax for the same.

I have tried the following and it runs without taking in the 'ALL' input.
Code:
send_files.ksh > $LOG/Sep21.log 2>&1  & <<EOF
> ALL
> EOF

Any help would be much appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Input Redirection

Hi everybody, first of all i am a new member in UNIX.com and this is my first post. I am impressed with the amount of information a person can ever have in this forum, it is really great having something similiar; anyways let me tell you about the problem I am having, hope you will answer me.... (6 Replies)
Discussion started by: majeed73
6 Replies

2. UNIX for Dummies Questions & Answers

background job

I try to run a script as background job. script: #!/usr/bin/csh /usr/bin/date +20%y-%m-%d > ~/datsql.txt If I start it I got this output: tac> ./datermitteln& 293 + Stopped (SIGTTOU) ./datermitteln& I insert the following line inside my script, but without any... (3 Replies)
Discussion started by: joerg
3 Replies

3. UNIX for Dummies Questions & Answers

Background job

Hiya, Recently I've run a few scripts in the foreground, but have realised later they should of been better nohup'd and placed in the background. I understand how to change a foreground job into a background one, but how would put the job into the nohup state? Thanks (1 Reply)
Discussion started by: rdbooth
1 Replies

4. UNIX for Dummies Questions & Answers

background job

on gnome i open a terminal and run wget http://soommmething & in the background. because wget shows me downloading progress percentage and download speed continuously, I exit the gnome-terminal after a while i want to see the download percentage but dont know how. my ps -u myname shows that... (3 Replies)
Discussion started by: babayeve
3 Replies

5. Shell Programming and Scripting

input redirection question

Hi, in my script I need to execute the following command: query $id 456 432 but it waits for a RETURN character from keyboard and therefore, it fails. I tried something like: query $id 456 432 << '\n' but, i'ts clear it is not correct. Is there any way to do this? Thxs. (0 Replies)
Discussion started by: luistid
0 Replies

6. Shell Programming and Scripting

Input redirection and for loop

Hello, I need help with a bash script that I try to improve. I could not find answer so far, maybe because I'm not to familiar with the terminology so feel free to correct my language. I have a script that looks like: NODES="node_a node_b node_c" for NODE in $NODES do ... (4 Replies)
Discussion started by: pn8830
4 Replies

7. Shell Programming and Scripting

Send Foreground job to background redirecting output

I have many CPU intensive processes running and sometimes I run them in the foreground so that I can see what the output is. I want to send that foreground process to the background, but also have it direct the output to a logfile. I know to send something to the bg I do Ctrl-z on the FG... (6 Replies)
Discussion started by: jhullbuzz
6 Replies

8. Shell Programming and Scripting

Background Job

Hello Everyody, Having a doubt. sort file1 & when we sent a job to the background it returns Job Number PID again if we want to ... (1 Reply)
Discussion started by: knroy10
1 Replies

9. UNIX for Dummies Questions & Answers

When do I use input redirection?

Can someone please explain when input redirection is necessary? For example, "cat filename" and "cat< filename" produce the same result. I was told that if I need to bunzip a file that I should type "bunzip2<filename.bz2." However, if I omit the "<" I still get the same result. Can someone... (4 Replies)
Discussion started by: PTcharger
4 Replies

10. Shell Programming and Scripting

Several exec on find send all the output to the last redirection

Example script: find mydir -type f -exec echo {}>aaa \; -exec echo {}>bbb \;The two paths go the the bbb file, while there should be one of them on each file. How should I do it to get it working? (2 Replies)
Discussion started by: Tribe
2 Replies
GEARMAN(1)							     Gearmand								GEARMAN(1)

NAME
gearman - Gearmand Documentation, http://gearman.info/ Command line client for Gearmand SYNOPSIS
Common options -f <function> Function name to use for jobs (can give many) -h <host> Job server host -H Print this help menu -p <port> Gearman server port -t <timeout> Timeout in milliseconds -i <pidfile> Create a pidfile for the process -n In client mode run one job per line, in worker mode send data packet for each line -N Same as -n, but strip off the newline Client options -b Run jobs in the background -I Run jobs as high priority -L Run jobs as low priority -P Prefix all output lines with functions names -s Send job without reading from standard input -u <unique> Unique key to use for job Worker options* -c <count> Number of jobs for worker to run before exiting -w Run in worker mode DESCRIPTION
With gearman you can run client and worker functions from the command line. HOME
To find out more information please check: http://gearman.info/ SEE ALSO
gearmand(8) libgearman(3) AUTHOR
Data Differential http://www.datadifferential.com/ COPYRIGHT
2012, Data Differential, http://www.datadifferential.com/ 0.33 May 04, 2012 GEARMAN(1)
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy