The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

Reply
 
LinkBack Thread Tools Display Modes
  #15 (permalink)  
Old 04-25-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 2,707
No need to put the host in backticks though, you already have that value locally.

Code:
host="10.72.169.$i"
server=`ssh -o ConnectTimeout=3 root@10.72.169.$i 'hostname'`
release=`ssh -o ConnectTimeout=3 root@10.72.169.$i 'cat /etc/redhat-release'`
echo "$host $server $release" >> result
Running two ssh:s to run two commands in sequence still seems very wasteful, but if you can't get it to work with both commands in the same ssh command line, I guess that's inevitable.
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0