[NTLUG:Discuss] Scripting help

Steve Litt slitt at troubleshooters.com
Fri Sep 26 00:30:34 CDT 2014


On Fri, 26 Sep 2014 00:02:55 -0500
Rusty Haddock <rusty at fe2o3.lonestar.org> wrote:

> I wasn't quite sure what you were asking for but here
> is my shot.
> 
> If that list of hosts, one per line, can go into a file try this:
> 
>     for i in $(cat hostlist)
>     do
>        telnet $i
>     done
> 
> I'm starting to be won over by the $( commands ) notation
> instead of grave accents.

I thought that was valid only on bash, but it just worked for me on
dash, zsh and ksh. Maybe I'll start using that instead of backticks.

Thanks,

SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance




More information about the Discuss mailing list