sed question

Leo de Wit leo at philmds.UUCP
Tue Jan 31 03:00:36 AEST 1989


In article <4094 at omepd.UUCP> merlyn at intelob.intel.com (Randal L. Schwartz @ Stonehenge) writes:
|In article <938 at philmds.UUCP>, leo at philmds (Leo de Wit) writes:
|| sed '/^Reply-To:/s/()/('$REALNAME')/g' your_file
|| 
|| Since the $REALNAME is outside quotes, it is expanded by the shell.
|
|Including the spaces.  This will break for REALNAME="Randal L. Schwartz".
|Try instead:
|
|  sed "/^Reply-To:/s!()!(${REALNAME-$USER})!g" your_file
|
|where "!" should probably be replaced with a control-G or some other
|very very unlikely character in REALNAME for safety.

If you had taken the trouble to read my own follow-up (sent out 5 min.
later, where I use the " quoting too), this reply hadn't been
necessary. You were probably as hasty to reply to my article as I
was to get it out 8-). Perhaps I'd better cancelled the first message ...

		Leo.



More information about the Comp.unix.questions mailing list