Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

return codes from rsh commands...

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 02-20-2002   -   Original Discussion by bbouch
bbouch's Unix or Linux Image
bbouch bbouch is offline
Registered User
 
Join Date: Feb 2002
Last Activity: 2 March 2002, 7:17 PM EST
Location: Maine
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unix or Linux Question return codes from rsh commands...

I have a Korn shell script that executes a number of commands on a remote server.

Is it possible to feed in the last exit code of the rsh commands (i.e. something like $?) to a variable within the local shell script?

I tried the following:

returncode=$(rsh spns31 ". /u/produser/.profile.spn31; sas ${SLIB}spbmb.test -LOG \"$JOBDIR/\"; ")

but returncode is always a 0. I assume this is because the rsh command worked ok, it was just the commands that were being executed within that which were bad.

Ideally, what I want is a way to get the value of the last command in the rsh step back to a variable in this script.

Is this possible?
Sponsored Links
    #2  
Old Unix and Linux 02-20-2002   -   Original Discussion by bbouch
PxT's Unix or Linux Image
PxT PxT is offline Forum Advisor  
Registered User
 
Join Date: Oct 2000
Last Activity: 7 May 2009, 12:22 PM EDT
Location: Sacramento, CA
Posts: 909
Thanks: 0
Thanked 4 Times in 4 Posts
Untested, but what about:

value=`rsh host "command1 ; command 2 ; echo $?"`
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Different Return Codes aarti.popi Shell Programming and Scripting 3 05-29-2009 07:53 AM
help with return codes ammu Shell Programming and Scripting 2 02-04-2008 01:57 PM
Return Codes kris01752 UNIX for Advanced & Expert Users 3 09-25-2006 12:40 PM
Return codes Bab00shka UNIX for Dummies Questions & Answers 4 02-02-2006 12:46 PM
Help with Return codes leezer1204 UNIX for Dummies Questions & Answers 1 04-26-2005 12:10 PM



All times are GMT -4. The time now is 04:08 PM.