[PATCH 0 of 1] tests: fix sed expression for BSD sed
Christian Ebert
blacktrash at gmx.net
Sat May 1 16:07:21 CDT 2010
Hi David,
* David Champion on Saturday, May 01, 2010 at 13:46:40 -0500
> * On 01 May 2010, Christian Ebert wrote:
>>>>> BSD sed expects a newline right after '\' in expressions like
>>>>>
>>>>> Wrapping the line right after '\' fixes the test-keyword test on FreeBSD
>>>>> here:
>>>
>>> FWIW none of them works on Solaris:
>>
>> Thanks. I'm gonna propose a fix, probably in python.
>
> Sed is a bundle of nonportability, but basic awk/nawk is generally quite
> portable.
>
> awk '{print} NR==1 {print "foo"}' a >a.tmp
>
> Tested on OSX (BSD awk), Linux (GNU awk), and OpenSolaris (System V
> awk).
This crossed with my python proposal which seems to be queued by
Matt. I wasn't sure about how portable awk would be, but you're
right for the basic commands. Thanks for taking the time looking
into it.
c
--
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions
More information about the Mercurial-devel
mailing list