From: "Martin Langhoff" <martin.langhoff@gmail.com>
To: "Michael Poole" <mdpoole@troilus.org>
Cc: "Stephen Rothwell" <git@ozlabs.org>,
"Josh Triplett" <josh@freedesktop.org>,
git@vger.kernel.org
Subject: Re: [PATCH] Remove useless uses of cat, and replace with filename arguments or redirection
Date: Wed, 6 Jun 2007 15:58:09 +1200 [thread overview]
Message-ID: <46a038f90706052058h1c823278o78ce0d8edce3caab@mail.gmail.com> (raw)
In-Reply-To: <87sl957naf.fsf@graviton.dyn.troilus.org>
On 6/6/07, Michael Poole <mdpoole@troilus.org> wrote:
> Stephen Rothwell writes:
>
> > On Tue, 05 Jun 2007 18:34:59 -0700 Josh Triplett <josh@freedesktop.org> wrote:
> >>
> >> -commits=$(cat ../revs | wc -l | tr -d " ")
> >> +commits=$(wc -l ../revs | tr -d " ")
> >
> > This is not equivalent, you probably wanted:
> >
> > commits=$(wc -l <../revs | tr -d " ")
>
> Which relevant version(s) of wc do not accept filename arguments?
> POSIX[1] seems to specify it. Or do you mean that there is some
> subtle difference in its processing of stdin vs specified files?
Josh is right. The output *is* different because it contains the
filename as well. See
$ wc < .gitk | tr -d " "
2177551
$ wc .gitk | tr -d " "
2177551.gitk
cheers
m
next prev parent reply other threads:[~2007-06-06 3:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-06 1:34 [PATCH] Remove useless uses of cat, and replace with filename arguments or redirection Josh Triplett
2007-06-06 3:39 ` Stephen Rothwell
2007-06-06 3:51 ` Michael Poole
2007-06-06 3:58 ` Martin Langhoff [this message]
2007-06-06 4:54 ` Stephen Rothwell
2007-06-06 6:38 ` Martin Langhoff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46a038f90706052058h1c823278o78ce0d8edce3caab@mail.gmail.com \
--to=martin.langhoff@gmail.com \
--cc=git@ozlabs.org \
--cc=git@vger.kernel.org \
--cc=josh@freedesktop.org \
--cc=mdpoole@troilus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).