Unix Shell - I dont see the error!

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2007 > I dont see the error!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author I dont see the error!
rickm@galaxy.nsc.com

2007-12-19, 7:27 pm

>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?

Ed Morton

2007-12-19, 7:27 pm



On 12/19/2007 5:27 PM, rickm@galaxy.nsc.com wrote:
>
> 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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com