![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 06: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 01: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 04:03 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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` |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|