Passing argument from one script to other

Dear All,

I have one script which accepts database name and user_id from the user, i have another script that will unload the data from all the tables based on the user_id accepted by the user. How can i pass the user_id from the 1st script to the other. My OS is sun solaris. Thanks in advance.

Regards,

lloyd

Out of multiple ways one way is to invoke the second script by providing the user_id as an command line argument to the script from the first script. Something like

#code of first script to take input of user_id and password

Second_script_name $user_id

In the second script use positional parameters to determine the value associated for the first argument:

UserId=$1

I hope this helps.

I have tried this as suggested, but it does not work for me, below is what I thought would work, but it does not even stop at the sleep 3000 part, I know it is because of the ftp part but don't know how to solve as I tried it without FTP and it works a treat

#! /usr/bin/ksh
Name=`who am i | cut -f1 -d" "`
TTY=`who am i |awk '{print $2}'`
IpAdd=`finger -l |( grep $TTY )| awk '{ print $9 }'`
HOST=$IpAdd
echo "\n\t please enter in the name of the file thats in your uploads folder ! \c"
read FileName
USER=W21?."453
PASSWD=******
DIR=/uploads
exec 4>&1
ftp -nv >&4 2>&4 |&
print -p open $HOST
print -p user $USER $PASSWD
print -p cd c:\
print -p dir c:\uploads
print -p binary
print -p get $DIR/$FileName /u1/excel/SplitF/$FileName
print -p bye
wait
/u1/excel/SplitF/FileSplitter $FileName ##### your suggested code
exit
bye
...............................................................................

2nd script

#! /bin/sh
rm /u6/SplitFiles/*.?? > /dev/null
echo $1
sleep 30000

because I can't get the variable from the 1st to the 2nd script I have to prompt for input within the second script again

ie ....
echo " Choose from the list above the file you wish to split ... \c"
read FileName

and when I done with splitting, I then have to prompt again for the new created file's
output.aa ouput.ab etc...etc..
any help would be great!

Here's a link to automate ftp stuff...i posted it earlier - dont know if it was this site or another..It may help in whatever is hanging the program.

Auto FTP info.