[NBLUG/talk] Shell scripts and stdout

Ross Thomas boscorama at fastmail.us
Thu Jan 13 19:25:34 PST 2005


On Thu, 13 Jan 2005 16:56:33 -0800, "David" <shadoweyez at hotpop.com>
said:
> For all you shell script wizards:
> 
> I'm making a shell script that will log into the machine on the network 
> with the lowest load average, using rlogin, ...

I agree whole-heartedly with Mitch on the use of ssh here.

> set UPHOST = ruptime -lr | grep up | head -n 1 | awk '{ print $1 }'
> and then rlogin $UPHOST but to no success.

Yep.  Those pesky back-ticks/quotes/accents/....

Try this (subject to Mitch's ssh recommendation):
   rlogin `ruptime -lr | awk '/up/ {print $1; exit}'`

HTH

Ross.




More information about the talk mailing list