From: "Sean" <seanlkml@sympatico.ca>
To: "Daniel Barkalow" <barkalow@iabervon.org>
Cc: "Linus Torvalds" <torvalds@osdl.org>, git@vger.kernel.org
Subject: Re: [PATCH] Fix use of wc in t0000-basic
Date: Fri, 20 May 2005 21:08:57 -0400 (EDT) [thread overview]
Message-ID: <4600.10.10.10.24.1116637737.squirrel@linux1> (raw)
In-Reply-To: <Pine.LNX.4.21.0505202045580.30848-100000@iabervon.org>
On Fri, May 20, 2005 8:49 pm, Daniel Barkalow said:
> The version of wc I have (GNU textutils-2.1) puts spaces at the beginning
> of lines. This patch should work for any version of wc.
>
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> Acked-by: Junio C Hamano <junkio@cox.net>
> Index: t/t0000-basic.sh
> ===================================================================
> --- 58741c69570705801db4b785681790d636475695/t/t0000-basic.sh
> (mode:100755 sha1:9a557129d98b499bcd601903d6646de29ba4bfc5)
> +++ uncommitted/t/t0000-basic.sh (mode:100755)
> @@ -32,7 +32,7 @@
> find .git/objects -type d -print >full-of-directories
> test_expect_success \
> '.git/objects should have 256 subdirectories.' \
> - 'test "$(wc -l full-of-directories | sed -e "s/ .*//")" = 257'
> + 'test $(cat full-of-directories | wc -l) = 257'
>
> ################################################################
> # Basics of the basics
>
You can't do "wc -l filename" because some versionso of "wc" then include
the filename in their output and confuse things. That was the reason to
use "cat" in the first place. If you're going to use sed, just do away
with wc altogether:
sed -ne '$=' full-of-directories
And that should work everywhere to get a line count.
Cheers,
Sean
next prev parent reply other threads:[~2005-05-21 1:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-21 0:49 [PATCH] Fix use of wc in t0000-basic Daniel Barkalow
2005-05-21 1:08 ` Sean [this message]
2005-05-21 1:10 ` Daniel Barkalow
2005-05-21 1:13 ` Sean
2005-05-21 1:16 ` Daniel Barkalow
2005-05-21 1:43 ` Junio C Hamano
2005-05-21 10:37 ` Herbert Xu
2005-05-21 10:53 ` Junio C Hamano
2005-05-21 11:01 ` Herbert Xu
2005-05-21 17:24 ` Junio C Hamano
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=4600.10.10.10.24.1116637737.squirrel@linux1 \
--to=seanlkml@sympatico.ca \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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).