![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| how to mount a file system of a remote machine to local file system | cy163 | UNIX for Dummies Questions & Answers | 2 | 01-31-2008 09:04 AM |
| set variables on remote system | funksen | UNIX for Dummies Questions & Answers | 2 | 11-23-2007 06:44 AM |
| How to remote backup with AIX system | guest | AIX | 1 | 04-19-2007 05:45 AM |
| Boot from a remote system | hemant29 | UNIX for Dummies Questions & Answers | 1 | 01-30-2006 09:29 AM |
| Running ssh on a remote system? | cstovall | Shell Programming and Scripting | 1 | 09-12-2005 11:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Rsh: test $? on remote system.
Hi,
a little help. I need to test the return code of a list file command on a remote system (Unix) using the rsh command. More exactly, to test is a directory exists, I try the following command: rsh $remoteHost "ls -la " $DirRemote Now, if the $DirRemote is not correct and I test the $? I found 0. If I try to check the $? on remote system for this remote command, in this way rsh $remoteHost "ls -la " $DirRemote " ; echo $?" to capture a value different, the value is always 0, preceded by an error message. Any idea? Thanks in advance. Giovanni |
|
|||||
|
I really don't know anything about the rsh command, but you could try PxT's idea.. no idea if it works or not since the OP never responded.
Here's another post, but I'm not sure how much help it'll be either. |
|
||||
|
Originally posted by gio123bg
rsh $remoteHost 'ls -la $DirRemote >/dev/null 2>$1 ; echo $?' ---------------------------------------------------------------------------------- Won' t you think using single quotes for the whole thing will be good like 'rsh $remoteHost 'ls -la $DirRemote >/dev/null 2>$1 ; echo $?' I think this will tell you if the rsh fails and your ls passes. Cheers JK |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|