SUMMARY: Quick script question

From: Jeff Kennedy <jlkennedy_at_amcc.com>
Date: Tue Oct 02 2001 - 10:25:15 EDT
Thanks to Roger Leonard for a quick brain jumpstart.

for X in `cat /path/to/input`

I was trying to define a variable and use that when all I really needed
was to read the input in the for statement itself.

Thanks.

~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
Received on Tue Oct 2 15:25:15 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:32:32 EDT