[Gllug] Bizarre shell behaviour
Bruce Richardson
itsbruce at uklinux.net
Fri Nov 7 23:57:55 UTC 2003
On Fri, Nov 07, 2003 at 11:27:51PM +0000, Dylan wrote:
> On Friday 07 November 2003 17:16 pm, Tethys wrote:
> > Take the following shell script. Run it:
> >
> > #!/bin/sh
> >
> > count=0
> > while read var
> > do
> > count=1
> > done < /etc/group
> >
> > echo $count
>
> Just out of interest (and 'cos I'm trying to learn shell scripting) can
> someone explain what this is supposed to achieve. The loop is obvious, but
> what's the redirection all about?
It's reading from the file /etc/group, one line at a time.
--
Bruce
I object to intellect without discipline. I object to power without
constructive purpose. -- Spock
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 261 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20031107/12c817db/attachment.pgp>
-------------- next part --------------
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list