bug-grep
[Top][All Lists]
Advanced

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

Re: [PATCH 0/6] *** SUBJECT HERE ***


From: Jim Meyering
Subject: Re: [PATCH 0/6] *** SUBJECT HERE ***
Date: Sat, 06 Mar 2010 10:19:50 +0100

Paolo Bonzini wrote:

>>> +echo a | grep -P a>/dev/null 2>err || skip_
>>
>> Please give skip_ an argument to tell why the test is being skipped.
>>
>>> +compare err /dev/null || fail_
>>
>> Same for fail_ here, and below.
>
> Done.
>
>>> +REGEX=a
>>> +
>>> +echo 'abc
>>> +0def
>>> +0ghi
>>> +0aaa
>>> +0gah' | tr 0 \\0>  in
>>
>> You could also do it all one line:
>>
>>    printf 'abc\0def\0ghi\0aaa\0gah\n'>  in
>>
>> either way is ok.
>
> I wasn't sure of the portability of \0 in printf, but indeed this is nicer:
>
>   printf "%s\n0" abc def ghi aaa gah | tr 0 \\0 > in

Based on it's use in coreutils' test scripts, I'm
confident that using printf with \0 is portable enough,
so I'd recommend this:

  printf '%s\n\0' abc def ghi aaa gah > in




reply via email to

[Prev in Thread] Current Thread [Next in Thread]