Sed and Bash; unterminated 's' command

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: David Mandala
Date:  
Subject: Sed and Bash; unterminated 's' command
I'm actually not sure. I had to make 250+ edits to 60 files and I ran
out of time so I went with what worked. My script was more like

line 1 > edit.lst
line 2 >> edit.lst
...
line 30 >> edit.lst

sed -f edit.lst

So be happy yours was short. (-;

Cheers,

Davidm


On Wed, 2003-03-19 at 08:30, Liberty Young wrote:
> On Wed, 2003-03-19 at 08:23, David Mandala wrote:
> > Try this instead of the space. I just had a long fight with sed myself.
> >
> > edit fix.sh and put in it:
> >
> > #!/bin/sh
> >
> > echo "s/^foobar[[:blank:]]/foo bar/p" > edit.lst
> >
> > sed -f edit.lst processedfile > processedfile.fixed
> >
> > rm -f edit.lst
> >
> >
> > Then run it. If I add the ;p I get a different error but the insertion
> > of the "foo bar" works fine.
> >
> >
>
> It works, thanks!
>
> Still, one would think i could get away with not having to store it in a
> temp. file within a bash script.
>
> What exactly is bash doing that is mangling the sed statement?
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

--
David IS Mandala
gpg fingerprint 8932 E7EF CCF5 1B8C 1B5C A92E C678 795E 45B2 D952
Phoenix, AZ (480) 460-7545 HP, (602) 741-1363 CP
http://www.them.com/~davidm/