shell scripting gurus?

Hal Burgiss hal at burgiss.net
Thu Jun 5 17:00:04 UTC 2008


On Thu, Jun 05, 2008 at 11:07:29AM -0400, Bart Silverstrim wrote:
> If I have a file of IP addresses, one per line, is there an easy way to 
> have a shell script read each line and perform an operation that plugs 
> that IP into another command?

file=ip_list.txt
cmd=something

cat $file |while read ip; do
     $cmd $ip
done

Untested. Surely a flub somewhere.

-- 
Hal
 




More information about the ubuntu-users mailing list