The UNIX and Linux Forums  

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


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to insert few lines in the called script suri Shell Programming and Scripting 7 03-06-2007 05:25 AM
Redirecting to standard output from within called script vigneshra Shell Programming and Scripting 8 07-04-2006 07:19 PM
Need help with ksh script that uses sqlplus, called from PHP j2owilson Shell Programming and Scripting 7 02-27-2006 12:35 PM
How to determine the script is called from CRON? wes_brooks Shell Programming and Scripting 15 09-10-2005 09:04 AM
gzip in shell script called by cron hbau419 Shell Programming and Scripting 2 02-05-2002 03:03 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2006
Registered User
 

Join Date: Oct 2006
Location: Pennsylvania
Posts: 1
Stumble this Post!
Red face Return info from a called external script

New to Unix scripting and have written two scripts, one calling the other. When it returns to the calling script is it possible to return information, like a return code?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-01-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,430
Stumble this Post!
The callee can use the exit statement to return a exit code. The caller can then refer to $? to get the exit code.

external_script
ret=$?
echo return code is $ret

For more complex returned data, the callee can display it on stdout with an echo statemtnt or something. Then the caller does:
complex_stuff=$(external_script)
or
complex_stuff=`external_script`
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0