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!
Quote:
Originally Posted by S.P.Prasad
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.