Home
Man
Search
Today's Posts
Register

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

return codes from rsh commands...

Tags
beginners

 

 
Thread Tools Search this Thread
# 1  
Old 02-20-2002
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?
# 2  
Old 02-20-2002
Untested, but what about:

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

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Return Codes... wisecracker UNIX for Dummies Questions & Answers 9 10-24-2013 05:35 PM
PID Capture and Return Codes dorrellg Shell Programming and Scripting 3 09-11-2009 01:26 PM
Different Return Codes aarti.popi Shell Programming and Scripting 3 05-29-2009 08:53 AM
sftp return codes TimHortons Shell Programming and Scripting 1 04-30-2009 10:55 PM
help with return codes ammu Shell Programming and Scripting 2 02-04-2008 02:57 PM
How do you Sum UNIX return codes z1tt45uuprs7 UNIX for Dummies Questions & Answers 3 10-18-2006 12:46 PM
Return Codes kris01752 UNIX for Advanced & Expert Users 3 09-25-2006 01:40 PM
Return codes Bab00shka UNIX for Dummies Questions & Answers 4 02-02-2006 01:46 PM
unix return codes abhib45 UNIX for Dummies Questions & Answers 1 01-27-2006 01:47 AM
Help with Return codes leezer1204 UNIX for Dummies Questions & Answers 1 04-26-2005 01:10 PM


All times are GMT -4. The time now is 10:00 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password