[NBLUG/talk] Shell scripts and stdout

David shadoweyez at hotpop.com
Thu Jan 13 20:33:53 PST 2005


Thanks both you guys.
Forgot about those ` vs ' vs ".

   Oh, as far as ssh vs. rlogin, this is on a school network, and we are 
writing these scripts for part of a school project.  You'll all be happy 
to know that we use ssh for actual working, but for  this assignment the 
instructor said to use rlogin.

Ross Thomas wrote:
> 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.
> 
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk
> 





More information about the talk mailing list