I dont see the error!

>sed "s/\"GDSII_FILE2\"/\strmout\/$LC_NAME.gds2\""/g" lvl.rsf

sed: -e expression #1, char 25: unknown option to `s'

strmout\/$LC_NAME fails only with a forward slash. Any other
charactor works.
What dont I see?
RickM [ Do, 20 Dezember 2007 00:27 ] [ ID #1891044 ]

Re: I dont see the error!

On 12/19/2007 5:27 PM, rickm [at] galaxy.nsc.com wrote:
> >sed "s/\"GDSII_FILE2\"/\strmout\/$LC_NAME.gds2\""/g" lvl.rsf
>
> sed: -e expression #1, char 25: unknown option to `s'
>
> strmout\/$LC_NAME fails only with a forward slash. Any other
> charactor works.
> What dont I see?
>

I'm surprised that's the only way it fails. You have too many double quotes. Or
rather, one in the wrong place. Try this:

sed -e "s/\"GDSII_FILE2\"/\"strmout\/$LC_NAME.gds2\"/g" lvl.rsf

This is still susceptible to bizarre failure reports based on the value of
"$LC_NAME" (e.g. try that statement if LC_NAME contains a newline). This is more
robust:

awk -v rep="strmout/$LC_NAME.gds2" 'gsub(/"GDSII_FILE2"/,"\""rep"\"")1' lvl.rsf

Regards,

Ed.
Ed Morton [ Do, 20 Dezember 2007 00:53 ] [ ID #1891045 ]
Linux » comp.unix.shell » I dont see the error!

Vorheriges Thema: comparing PID values of 2 Files in shell
Nächstes Thema: CD-ROM of "UNIX SHELLS by EXAMPLE 4th"