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: Paolo Bonzini
Subject: Re: [PATCH 0/6] *** SUBJECT HERE ***
Date: Sat, 06 Mar 2010 10:14:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1


+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

It is slightly different in that it adds a trailing NUL, but testing its absence should be a topic for another test.

Paolo




reply via email to

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