Sponsored Content
Full Discussion: RSH command
Top Forums Shell Programming and Scripting RSH command Post 82303 by blowtorch on Tuesday 30th of August 2005 04:53:43 PM
Old 08-30-2005
From the man page of remsh:
Quote:
RETURN VALUE
If remsh fails to set up the secondary socket connection, it returns
2. If it fails in some other way, it returns 1. If it fully succeeds
in setting up a connection with remshd, it returns 0 once the remote
command has completed. Note that the return value of remsh bears no
relation to the return value of the remote command.
So if you are trying to find the exit status of the remote command, well, you cant. Also your remsh is setting up a connection with remshd successfully, so it returns success and your "&& echo" command goes through.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Rsh command

Newbie here, I want to add a line to our 3D rendering scripts that will send an email to the animators once a scene has finished rendering. The 3D scripts are on the client hosts and the sendmail setup on the server. I tried using a rsh line in the script as follows rsh root@blah echo... (2 Replies)
Discussion started by: flamethrower
2 Replies

2. UNIX for Dummies Questions & Answers

rsh command

Hi, I'm performing a data migration from an Ingres db to an Oracle db. The ingres database lives on a unix host running "UNIX(r) System V Release 4.0 (SunOS 5.5.1) ", while the Oracle database lives on another unix host running "SunOS 5.8". Part of the migration is to remotely run Oracle's... (1 Reply)
Discussion started by: strpeski
1 Replies

3. UNIX for Dummies Questions & Answers

.rhosts and rsh command

Hello all, Ok. Here it the scope I have two Redhat 7.2 machine which I use to test things on. I have a home directory which is NFS mounted via NIS. I have a .rhosts file in the directory with the name of the machine and username, with permission 600. Be when I try to run a rsh command I get... (6 Replies)
Discussion started by: larry
6 Replies

4. Shell Programming and Scripting

rsh command in a while loop

Hi , reading a "file1" with 2 data in each line (VAR1 and VAR2) , i'm using a while loop like this : cat file1|awk '{print $1,$2}'|while read VAR1 VA2 do echo $VAR1 echo $VAR2 done as this example shows , it works but if between do and done i use a "rsh" command , the script reads... (6 Replies)
Discussion started by: Nicol
6 Replies

5. UNIX for Dummies Questions & Answers

rsh command

Hi, I am a beginner and i want to seek help I want to use the rsh command. Is there a possibility that i can do it without the system password I am planning to make a csh script that could browse/copy files from diferent workstations. thank you.... (5 Replies)
Discussion started by: wramonzon
5 Replies

6. Linux

rsh command

we want to execute remote script via rsh (we just only should use rsh except others),but rsh command can not set environment variable for specify user, then scripts can not be executed correctly,anyone knows how to fix this problem? thanks. (8 Replies)
Discussion started by: Frank2004
8 Replies

7. Solaris

Problems with rsh command

Hello guys, I have a script in a Linux server, from where I go to 3 Sun servers and run process. Now i have done an upgrade and increase 1 Sun server more, now i need to run the shell in the Linux Server (into the shell is rsh command), but when i try to do ir with the new Sun server, i hace the... (3 Replies)
Discussion started by: lestat_ecuador
3 Replies

8. Shell Programming and Scripting

rsh command

Hi Does anybody know how to to return the exit code of a remote command when using rsh? I know that "rsh" has no built-in ability for that. The echo $? is showing the results of the rsh command. Not the remotely executed command. I am trying to get the return code of psef command from... (4 Replies)
Discussion started by: aoussenko
4 Replies

9. Shell Programming and Scripting

rsh connection using embedded command

Hello, I am doing an rsh connection to server2. I want to perform several command on server2. I.E: i=1 rsh server1 -l username "z=$i;`script.ksh`" (1)Is this the right way to give z value to be used on server2? (2) Is this the right way to run a script on server2? (1 Reply)
Discussion started by: LiorAmitai
1 Replies

10. Shell Programming and Scripting

rsh command - ksh

Hello, I am trying to run a remote file (y.ksh) using rsh. In this action i want to use an environment variable TOOL=/home/macc1 i am running the rsh from profile macc on server1. rsh server2 -l macc1 "$TOOL/y.ksh" but i can see that the executable command = /home/macc/y.ksh and not... (1 Reply)
Discussion started by: LiorAmitai
1 Replies
netrc(4)						     Kernel Interfaces Manual							  netrc(4)

NAME
netrc: .netrc - login information for ftp, rexec, and rexec() DESCRIPTION
The file contains login and initialization information used by the autologin process, by the library routine, and by the command (see ftp(1), rexec(3N), and remsh(1)), respectively. This file is optional. It exists, if at all, in the user's home directory. If the file contains password or account information for use other than for anonymous its owner must match the effective user ID of the current process. Its read, write, and execute mode bits for group and other must all be zero, and it must be readable by its owner. Oth- erwise, the file is ignored. The file can contain the following tokens, separated by whitespace (spaces, tabs, or newlines) or commas To include a comma as part of a token, enclose that token in quotation marks (). Identify a remote machine name. The autologin process searches the file for a token that matches the remote machine specified on the command line, as an command argument, or as the parameter of Once a match is made, the subsequent tokens are processed, stopping when the end-of-file is reached or another token or a token is encountered. If the remote machine name has an alias host name, and both the official host name and the alias are present in the file, the client gives precedence to the official host name over the alias when searching the file. If an alias is given as an entry to the command, and in the search from the top of the file to the bottom, the client finds the alias host name before it finds the official host name, it will use the alias's entry. However, if it finds the official host name first, it will use the official entry even though the alias host name also exists in the file. So the high precedence given to the official host name requires placing the official host name entry last in the file for when aliases exist. Same as except that matches any name. There can be only one token, and it must be after all tokens. This is normally used for as follows: This provides automatic anonymous login to machines not specified in This can be overridden in by using the flag to disable autologin. Identify a user on the remote machine. If this token is present, the or autologin process initiates a login using the specified name. If this token matches the user name used by the command option, or, by default, the local user name, uses the token, if present. Supply a password. If this token is present, the autologin process supplies the specified string, if the remote server requires a password as part of the login process. Note that if this token is present in the file for any user other than aborts the autologin process if the is readable by anyone other than the owner. Also note that the passwords in are not encrypted. Supply an additional account password for login. If this token is present, the autologin process supplies the specified string if the remote server requires an additional account password, or the autologin process initiates an command if it does not. Define an macro. This token is just like the command. A macro is defined with the specified name; its contents begin with the next line and continue until an empty line (consecutive newline characters) is encountered. If a macro named is defined, it is automatically executed as the last step in the autologin process. EXAMPLES
The following is a valid entry for the host whose account has the password WARNINGS
It is a security risk to have unencrypted passwords in a file. AUTHOR
was developed by the University of California, Berkeley. FILES
SEE ALSO
ftp(1), remsh(1), rexec(3N). netrc(4)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy