The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 09:25 AM
Redirecting to standard output from within called script vigneshra Shell Programming and Scripting 8 07-04-2006 10:19 PM
Need help with ksh script that uses sqlplus, called from PHP j2owilson Shell Programming and Scripting 7 02-27-2006 04:35 PM
How to determine the script is called from CRON? wes_brooks Shell Programming and Scripting 15 09-10-2005 12:04 PM
gzip in shell script called by cron hbau419 Shell Programming and Scripting 2 02-05-2002 07:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-01-2006
cathrop cathrop is offline
Registered User
  
 

Join Date: Oct 2006
Location: Pennsylvania
Posts: 1
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?
  #2 (permalink)  
Old 11-01-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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`
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0