Re: [PATCH] t5540-http-push.sh: avoid non-portable grep -P

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin wrote:
> 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'

> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux