ENV vars in SED patterns
Posted on 1998-04-03
In a csh script, I want to use 'sed' to substitute a placeholder pattern with user's full names (extracted from GCOS with a targeted grep/cut operation and set to variable $NAME).
The script line I have goes like this:
sed -e 's/PUTNAME/'$NAME'/' < $LOC/.vacation.msg1 > $LOC/.vacation.msg
Problem is: 'sed' doesn't like the space between first and last name:
sed: command garbled: s/PUTNAME/Cal
(note how it drops my last name)
Can someone suggest a better sed string and comment on quoting variables in 'sed'?