[PATCH 0 of 1] tests: fix sed expression for BSD sed

David Champion dgc at uchicago.edu
Sat May 1 13:46:40 CDT 2010


* 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).

-- 
 -D.    dgc at uchicago.edu    IT Services    University of Chicago


More information about the Mercurial-devel mailing list