Parameters and background


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Parameters and background
# 1  
Old 11-14-2007
Parameters and background

Hello everyone,
can you advice on how to execute a script passing parameters to it as well as requesting it to run in the background?
It seems that my last character of the command line (& for background execution) gets taken in as an additional parameters and the job runs in the foreground.
Thanks
# 2  
Old 11-14-2007
Sure.

Code:
some-command some arguments &

# 3  
Old 11-14-2007
A follow up to porter

Porter,
when I type :

scriptname param1 param2 param3 &

this statement executes the script named scriptname in the foreground even though I have the &.
It seems to think the & is param4 for the command.
Any idea?
Thanks!
# 4  
Old 11-14-2007
What shell are you using?
# 5  
Old 11-14-2007
Porter,
tcsh
# 6  
Old 11-14-2007
What platform?

Are you using some strange character set?

What interface/terminal etc are you using?

Can you paste exactly the command here?
# 7  
Old 11-14-2007
Porter,
I am running on AIX unix 5.3.0.0-5
it starts up in ksh, I enter tcsh to get into my c shell.
From there I run my script abc.ksh passing parameter PROD and Y .
the execution line is :
%abc.ksh PROD Y
The first line of the script is:
#! /bin/ksh
This runs fine in the foreground.

Now if I do this:
%abc.ksh PROD Y &
the script abc still runs in the foreground .... should I escape the &?

Any other script which does not need params executes in the background when it gets invoked and & is given at the time of execution.

I do not think is a terminal or character set issue.


Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting parameters

Hi, I have 2 scripts one master.sh and child.sh. The master runs on a separate server and pushes the child script to the desginated server and runs it.The child script configures the designated server for our day to day use and it has lot of interactive questions which help the... (4 Replies)
Discussion started by: a12ka4
4 Replies

2. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

3. Shell Programming and Scripting

Xclock and background

Hi everyone, could you explain why am I not able to bring up xclock, or for that matter any Xtools (xcalc etc...), in the background? When I execute: xclock & This brings up the clock in the foreground, my focus is on the clock, not back in my command window. Any suggestion? ... (2 Replies)
Discussion started by: gio001
2 Replies

4. Shell Programming and Scripting

More than nine parameters

Hi, please tell me the systax for passing 11 variables(including 4compulsory variables) in shell program. ORA_USERPASS=`echo $1` USERID=`echo $2` USERNAME=`echo $3` REQUESTID=`echo $4` P5=`echo $5` P6=`echo $6` P7=`echo $7` P8=`echo $8` P9=`echo $9` shift P10=`echo $9` shift... (3 Replies)
Discussion started by: anitha126
3 Replies

5. Shell Programming and Scripting

wait in background

can a wait command be run in background? or the script which has the wait command, be run background? test.sh ------- nohup a.sh & nohup b.sh & wait nohup test.sh & How can i run either wait or test.sh in background? i want test.sh to wait till a.sh and b.sh complete, and must be... (1 Reply)
Discussion started by: albertashish
1 Replies

6. UNIX for Dummies Questions & Answers

Background jobs

If I run a job in the background and logoff. Will the job continue to run or will my processes be killed ? (1 Reply)
Discussion started by: jxh461
1 Replies

7. Shell Programming and Scripting

parameters

i'm supposed to come up with a script that -accepts a directory as an optional command line parameter -display an error message and terminates if more than one parameter is provided -use the current directory if no parameter is provided -displays an error message and terminates if the provided... (4 Replies)
Discussion started by: jaay
4 Replies

8. UNIX for Advanced & Expert Users

background output

Question: I run a script to check a filesystem or two and put it in the background vi a ssh session. Now, upon killing the window(ssh session) the script will of course keep running, BUT if I log back into the box via ssh how can I get the output of the script back to my ssh session/window? ... (3 Replies)
Discussion started by: smtpgeek
3 Replies

9. Shell Programming and Scripting

parameters

I have a script that needs to check if the given parameters are a combination of 0123456789 and not a word or another irelevant character.please help (6 Replies)
Discussion started by: aekaramg20
6 Replies

10. Shell Programming and Scripting

Need Parameters Help.

I can test for one parameter but anything more then that and I get an Error. I forgot I run this batch in a shell #!/bin/sh ------------------------------------------------------------------------- Write a batch program that accepts a keyword as a parameter and finds all the files... (3 Replies)
Discussion started by: james2006
3 Replies
Login or Register to Ask a Question