tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ autoconf always sets variable

Cargo Cult programmers? ▻

filesize -> variable

In article <949582467.19012.2.nnrp-11.c2deb51d@news.demon.co.uk>,
Adam Price <adam+usenet@pappnase.demon.co.uk> wrote:
>>FOO=`wc -c < /my/file`

>Even the way you have the command written here?
>I would have thought the 'File' being counted here is stdin.

Yes, it's standard input, but it's still a regular file, which you can
stat(), lseek(), and so on.  It was opened by the shell, which arranged
that it would be file descriptor zero for the `wc' process, but there is
no deeper magic going on than that.

If Ken had instead said

    FOO=`cat /my/file |wc -c`

you would be right, and Randal would pop up with a UUOC :-).

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: filesize -> variable
Date: 3 Feb 2000 13:15:23 -0000
Message-ID: <87bv21$5fr$1@ltpcg.star.le.ac.uk>
References: <3897B1E6.AE5CCAFD@email.dk> <slrn89hle4.22c.kura@fobos.pl>
  <slrn89iiu5.136.ken@pulsar.halcyon.com>
  <949582467.19012.2.nnrp-11.c2deb51d@news.demon.co.uk>

△ comp.unix.shell △

◅ autoconf always sets variable

Cargo Cult programmers? ▻