call another script and have the inital script exit
Hello,
Sorry if this has been asked/answered before - I looked but couldn't find exactly what I'm looking for. What I want is this: I want to execute a script, and from within that echo some variables to a text file (I couldn't find another way to do it) - then call a second script from within that script and read those variables from the text file. Here's a cutout of the two scripts:
#!/bin/bash
UPLOAD_VUSER="cmc"
UPLOAD_SIZE="1223344"
echo ${UPLOAD_VUSER},${UPLOAD_SIZE} > /tmp/variables
source /tmp/exec2.sh
exit 0
#!/bin/bash
UPLOAD_VUSER=`cut -d"," -f1 ./variables`
UPLOAD_SIZE=`cut -d"," -f2 ./variables`
echo ${UPLOAD_VUSER}
echo ${UPLOAD_SIZE}
exit 0
All is fine, the second script 'exec2.sh' is called and run - but the first script still exists. Is there a way to call the second script and then immediately exit the first script? Any help would be appreciated.
Thanks,
mjtice
|