From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Pavel Roskin <proski@gnu.org>
Cc: git@vger.kernel.org
Subject: Re: [COGITO PATCH] Optimized print_help()
Date: Wed, 15 Jun 2005 20:58:55 +0200 [thread overview]
Message-ID: <42B07A6F.3000001@lsrfire.ath.cx> (raw)
In-Reply-To: <1118795583.3890.27.camel@dv>
Pavel Roskin schrieb:
>>> + cat $toolpath | sed -n '3,/^$/s/^# *//p'
>>
>> What about also removing UUOC from this line ...
>
>
> UUOC? I had too look it up :-)
>
> It's not just "useless use of cat", but also useless use of
> redirection in both cases. I guess sed can exit after it finishes
> processing the range (I don't know if it actually does), so feeding
> it the whole file is not need.
It doesn't matter if the shell opens the file or if sed does it itself,
sed's ability to close the file and quit when done doesn't depend on
that. So this call is equivalent and has the advantage of being
resistant against filenames starting with a "-":
sed -n '3,/^$/s/^# *//p' <"$toolpath"
Rene
next prev parent reply other threads:[~2005-06-15 18:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-14 23:26 [COGITO PATCH] Optimized print_help() Pavel Roskin
2005-06-15 0:00 ` Jonas Fonseca
2005-06-15 0:33 ` Pavel Roskin
2005-06-15 18:58 ` Rene Scharfe [this message]
2005-06-15 21:14 ` Pavel Roskin
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=42B07A6F.3000001@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=proski@gnu.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).