The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-05-2002
rvprod rvprod is offline
Registered User
 

Join Date: Jan 2002
Posts: 4
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

Last edited by oombera; 02-18-2004 at 01:58 PM..