Vee
August 13, 2015, 7:44pm
1
I have written a script which will take input parameter as another script.
However, if the script passed as input parameter has parameters then this script doesn't work.
I have a script b.ksh
which has 1 and 2 as parameters
I have a script c.ksh
which has 3,4 and 5 as parameters
vi a.ksh
USAGE="<SCRIPT_NAME>"
while [ 1 ]; do
nohup ${SCRIPT_NAME}
done
I call the scripts like this
ksh -x a.ksh b.ksh 1 2
ksh -x a.ksh c.ksh 3 4 5
The above doesn't work though. Please help
vee:
I have written a script which will take input parameter as another script.
However, if the script passed as input parameter has parameters then this script doesn't work.
I have a script b.ksh
which has 1 and 2 as parameters
I have a script c.ksh
which has 3,4 and 5 as parameters
vi a.ksh
USAGE="<SCRIPT_NAME>"
while [ 1 ]; do
nohup ${SCRIPT_NAME}
done
I call the scripts like this
ksh -x a.ksh b.ksh 1 2
ksh -x a.ksh c.ksh 3 4 5
The above doesn't work though. Please help
I'm not sure where to start:
You assign a seemingly meaningless string to the variable USAGE
, but you never use that variable.
You use the variable SCRIPT_NAME
, but you never assign it a value.
You have a while
loop to repeatedly nohup
nothing.
None of the code in your script uses any arguments passed to your script.
If you want to run b.ksh
with the arguments 1
and 2
, why don't you just invoke:
b.ksh 1 2
? Why do you need a.ksh
?
Please explain more clearly what you are trying to do with this script!