while loop throws an error in ssh
Hi All,
Here is the script which i have prepared to ssh to different servers and find out their OS name: Code:
#!/bin/ksh Quote:
Quote:
|
Your script doesn't make sense, when you ssh you are attempting to start an interactive ssh session on a remote system. IF that worked (which it won't) then the script will present the user with a login prompt and then just sit there waiting for a password (or straight to a bash prompt if your'e using a key. The code you are apparently expecting to use to find the OS will NOT run on the remote server. At some point the ssh session will close, and when the ssh client process terminates, then the rest of the code will run on the LOCAL machine. This isn't going to do what you want.
update the ssh command to run uname there: Code:
REMOTE_UNAME=$(ssh -p 56786 -l testuser $host uname -a) |
Quote:
i am trying to ssh remote servers from server_list.txt file. |
All times are GMT -5. The time now is 12:14 AM. |