git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Johannes SchindelinNext: Junio C Hamano
Message 15 of 17 in “t5540-http-push.sh: avoid non-portable grep -P”
  1. t5540-http-push.sh: avoid non-portable grep -PJay Soffian, Feb 26, 2009
  2. Junio C HamanoFeb 26, 2009
  3. Jay SoffianFeb 26, 2009
  4. Jay SoffianFeb 26, 2009
  5. Junio C HamanoFeb 26, 2009
  6. Jay SoffianFeb 26, 2009
  7. Junio C HamanoFeb 26, 2009
  8. Jay SoffianFeb 26, 2009
  9. t5540-http-push.sh: avoid non-portable grep -PJay Soffian, Feb 26, 2009
  10. Junio C HamanoFeb 26, 2009
  11. Jay SoffianFeb 26, 2009
  12. t5540-http-push.sh: avoid non-portable grep -PJay Soffian, Feb 26, 2009
  13. Brandon CaseyFeb 26, 2009
  14. Johannes SchindelinFeb 26, 2009
  15. Brandon CaseyFeb 27, 2009
  16. Junio C HamanoFeb 27, 2009
  17. t5540-http-push.sh: avoid non-portable grep -PJay Soffian, Feb 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.