Re: [PATCH] t5540-http-push.sh: avoid non-portable grep -P
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Feb 27, 2009, 00:12 UTC
- Message-ID
- <4WGE1cq9SGp9DuzqT2ZuVN0RzLGmBe1mAX4n1O4-TNyRqiZqxDP62A@cipher.nrlssc.navy.mil>
- In-Reply-To
- <alpine.DEB.1.00.0902270056270.10279@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
Show 11 quoted lines
> Hi, > > On Thu, 26 Feb 2009, Brandon Casey wrote: > >> sed -e 'script' input-file >> >> rather than >> >> sed -e 'script' < input-file > > What should make the former more preferable to the latter?
It's less complex, but as you describe in the next paragraph, if the file name is not desired in the result then the latter is preferable. I initially viewed the latter form as a useless use of cat, equivalent to:
cat input-file | sed -e 'script'
Show 5 quoted lines
> Especially given that the latter way is preferable with other commands (at > least as far as our test suite is concerned), such as grep, because you do > not get the file name as part of the result? > > And especially given that sed means _stream_ editor, not file editor?
especially? Your first argument is valid, but this last sentence means nothing.
-brandon