Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 1997 09:49:50 +0200
From:      Nadav Eiron <nadav@barcode.co.il>
To:        Jim Bentley <jimbo@intcomm.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: csh scripting
Message-ID:  <32E7181E.F34@barcode.co.il>
References:  <199701230036.SAA01696@main.intcomm.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Jim Bentley wrote:
> 
> When attempting to execute a foreach command in csh script the variables are
> not set correctly.
> 
> foreach user (cat /usr/local/www/file.lst)
> 
> The user variable is set equal to "cat /usr/local/www/file.lst" instead of
> the the data in the lines of the file.
> 
> Any ideas.
> Thanks
You need the backquotes, like so:
foreach user (`cat /usr/local/www.file.lst`)

Nadav



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32E7181E.F34>