Script1 is invoked by process. It is not manual. When this process makes Script1 run I want it to pass a parameter to Script2. There is more code in Script1 than what I am showing. I want Script2 to contain code outside of Script1 because there are 13 other scripts that use the code in Script2. I do not want to have to maintain the code in 13 scripts.
The code inside Script1 is:
Code:
..............
..............
nohup ./Script2 $ARE
..............
..............
Then the code I have inside Script2 is:
Code:
if [ -z $1 ]
# Checks if any params.
then
echo "No parameters passed to function."
return 0
else
PARAM = $1
if [ ! -r $INDIR/$PARAM/* ]
then
#NO FILE IN THE IN DIRECTORY
else
ftp -vn xxx.xxx.xxx.xxx <<- eof
user pswd
bin
mput *
bye
eof
fi
fi
added code tags for readability --oombera