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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
returning values from shell script to calling C program nehamore Shell Programming and Scripting 2 02-04-2008 11:09 AM
The shell script is not returning proper result clnsharma123 AIX 1 01-25-2008 04:54 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 07:05 AM
Returning Strings from C program to Unix shell script satguyz High Level Programming 11 12-30-2005 03:41 PM
Returning values from child to parent shell acheepi Shell Programming and Scripting 4 07-15-2005 03:25 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-27-2001
jennifer01 jennifer01 is offline
Registered User
  
 

Join Date: Nov 2001
Posts: 1
Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process.
I know that we can use $? to get the final status but this is on unix command. How can I return a value from the script??????
  #2 (permalink)  
Old 11-27-2001
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
  
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
You could save the exit status of the program
and use it in the shells exit statement...

#!/bin/sh
...
you're script code
PROC_RET=$?

echo "Returning $PROC_RET to Informix" >> ./Debug.log
exit $PROC_RET
  #3 (permalink)  
Old 11-27-2001
wizard wizard is offline
Registered User
  
 

Join Date: Nov 2001
Posts: 60
Look at the popen() subroutine in the man pages.
  #4 (permalink)  
Old 11-29-2001
_r€d _r€d is offline
Registered User
  
 

Join Date: Nov 2001
Location: BehindThe7Hills
Posts: 3
Re: Returning Values (shell Script)

return value of shell skripts is like booleans

--------------
example 1:
--------
ls
echo $? //(this returns 0 for true)

--------------
example 2:
--------
ls xyz
echo $? //(this returns 1 for false)
Sponsored Links
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 04:28 AM.


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