On 11/13/2010 04:40 PM, Bruno Haible wrote:
> Instead of changing every use of sed to $SED, why don't you define 'sed'
> as a function? Like this:
>
> if test "$SED" != sed; then
> sed ()
> {
> $SED "$@"
> }
> fi
>
> This will
> 1. follow the gnulib philosophy of separation of platform specific
> workarounds and the actual code that uses the workarounds,
> 2. reduce the danger that someone - not aware of of the limitations of sed -
> uses 'sed' instead of '$SED' in future modifications of the script.
By the way, you may want to do a similar fix for gnulib-tool, since a
quick search found at least one sed script that will fail with Solaris
/bin/sed:
# Update license.
sed_transform_main_lib_file=$sed_transform_main_lib_file'
s/GNU Lesser General/GNU General/g
s/GNU Library General/GNU General/g
s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
