Kenward Vaughan wrote:

> If I really had nothing better to do, I'd figure out a sed expression
> doing
> the same.  But I'm a hobbyist, and those slashes and spaces always screw
> me up when playing with sed...

;-)

# Take a line '\color white', store '\color ', to be retrieved with \1, and
# replace 'white' with 'black'.
sed 's/^\(\\color *\)white$/\1black/' in.lyx > out.lyx

or test with

echo '\color white' | sed 's/^\(\\color *\)white$/\1black/'


-- 
Angus

Reply via email to