Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-11-2005, 09:05 AM   #1
LQ Newbie
Registered: Feb 2005
Posts: 12

Rep: Reputation: 0
call another script and have the inital script exit

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:

echo ${UPLOAD_VUSER},${UPLOAD_SIZE} > /tmp/variables
source /tmp/
exit 0

UPLOAD_VUSER=`cut -d"," -f1 ./variables`
UPLOAD_SIZE=`cut -d"," -f2 ./variables`
exit 0

All is fine, the second script '' 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.

Old 09-11-2005, 11:54 AM   #2
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Re: call another script and have the inital script exit

Try to change
source /tmp/
/tmp/ needs execute permissions to do this.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Do not stop or exit from a script in case of error. philipina Linux - General 4 07-02-2004 06:52 AM
Invoke script on xsession exit? comp12345 Linux - Software 1 06-27-2004 10:27 PM
My shell script can't seem to call another script kakho Programming 3 04-17-2004 09:21 AM
script 'exit' command kilobravo Linux - General 8 01-16-2003 03:24 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration