![]() |
|
|
|
|
|||||||
| 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 |
| Exit Codes | cmschube | Shell Programming and Scripting | 1 | 04-04-2008 08:34 AM |
| difference b/t the exit codes $* and $@ | praveen_b744 | Shell Programming and Scripting | 1 | 09-19-2007 06:53 AM |
| Explanation for the exit codes 2 | sesedada | UNIX for Advanced & Expert Users | 1 | 06-24-2006 11:31 PM |
| Where can I find a list of exit codes? (Exit code 64) | jkuchar747 | UNIX for Dummies Questions & Answers | 3 | 12-07-2004 03:08 PM |
| exit codes | donna carter | High Level Programming | 3 | 05-31-2001 06:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
exit codes from rexec?
how do i/is there a way to return the exit code from the remote host?
echo $? from the local host only gives 0, if the rexec command itself executes successfully. But what if in the case of the remote command failiing? echo $? on the localhost still gives 0, but I'm interested in the exit code from the failing command on the REMOTE host... |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
On the remote host echo the exit code after the command has completed and use that on the localhost by using tail -1 on the output of the rexec command.
|
|
#3
|
|||
|
|||
|
hi reborg and all,
i tried that and it still returns 0. i even rexec'ed a nonsense command (something like "lsdflkjfd" - which I'm sure doesn't do anything...) and the echo $?, as in: rexec server1 "lsdflkjfd; echo $?" i log in with username and password, and it echoes back: ksh: lsdflkjfd: not found. 0 It still returns 0!!! |
|
#4
|
||||
|
||||
|
Single quotes otherwise the shell will expand $?
Here is what I get: Code:
# rexec aserver 'dummy; echo $?' ksh: dummy: not found 127 |
||||
| Google The UNIX and Linux Forums |