SUMMARY: Quick script question

From: Jeff Kennedy <>
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.



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
sunmanagers mailing list
Received on Tue Oct 2 09:23:18 2001

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