SUMMARY: Quick script question - second round

From: Jeff Kennedy <jlkennedy_at_amcc.com>
Date: Tue Oct 02 2001 - 10:34:58 EDT
Holy cow the answers came in fast, Roger just happened to be the first
but by the time I posted the summary I got 8 more.

Almost all suggested the same as Roger:

for X in `cat /path/to/input`
do
	bpimmedia -media $X

with one exception:

while read X
do
	bpimmedia -media $X

Thought this deserved mention as well.  Thanks to all for such quick
responses.

~JK


Jeff Kennedy wrote:
> 
> I am trying to write some NBU reports and have run into a snag (easy to
> do since I'm not a real scripter anyway).
> 
> I have a file containing all my media ID's and want to use that as input
> for another file.  I need to use the listing as a for loop so I am going
> on the assumption that something like this is needed:
> 
> medialist=`cat /path/to/file`
> for X in $medialist
> do
>         bpimmedia -media $X >> /path/to/log/file
> done
> 
> The medialist variable is where I'm having trouble.  This doesn't seem
> to work.  Do I need to use read somehow to make this work?  I would
> appreciate an example.
> 
> Thanks.
-- 
=====================
Jeff Kennedy
Unix Administrator
AMCC
jlkennedy@amcc.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Oct 2 09:32:17 2001

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:26 EST