cp foo{,.bak} not always supported

Gilles Espinasse g.esp at free.fr
Sun Jun 1 06:52:30 MDT 2008


It has been reported on ipcop-devel list that  cp foo{,.bak}  contruction is
broken on Ubuntu-8.04

This was on expect instructions

cp configure{,.bak}
cp: missing destination file operand after `configure{,.bak}'
Try `cp --help' for more information.

Could it not be prefered to build sed at the beginning, so it is always safe
to use sed -i?
That's what DYI do and what have been done on ipcop-1.4.
Anyway  splitting in two instructions (one cp, one sed) could be the most
portable way.

This construction is actually used on expect, gcc pass2, gzip, perl (in
perl, with mv, not cp)


Gilles



More information about the lfs-dev mailing list