Re: Sed replace doesn't work from shell script



In article <1122327610.551790.326920@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
takarov2003@xxxxxxxxx wrote:

> Please accept my apologies if this is not the right place to ask this
> question, but it appears that google doesn't echo a group for sed.
>
> my problem is that i have a file I wish to edit on pattern match,
> replacing the matched line with another line.
>
> from the command line I do:
>
> teufel# sed '/#auth./c\
> > auth replacement' /etc/syslog.conf > syslog.conf
>
> This works fine from the command line. When I put these same lines in
> a shell script, i get:
>
> sed: command garbled: /#auth/c\
>
> what am i missing here? substitution sed lines (one-liners) work fine
> in the same script.

Do you have any trailing white space following the \ ???

Bob Harris
.



Relevant Pages

  • SHELL Scripts
    ... Not sure where to post this...but I am having some trouble with a Shell Script. ... I am getting an error when I use the CALL command in the shell script. ... echo of the text inputed. ... GOTO EOF ...
    (microsoft.public.windowsxp.help_and_support)
  • Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... This works fine from the command line. ... a shell script, i get: ...
    (comp.lang.awk)
  • Re: Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... > This works fine from the command line. ... > a shell script, i get: ...
    (comp.unix.shell)
  • Re: loop and list with bash
    ... On 30 Sep 2004 08:55:35 GMT, Eric Belhomme ... > echo $item ... Check Google for "comp.unix.shell Frequently Asked Questions". ...
    (comp.unix.shell)
  • Basic Shell script question
    ... I have Solaris 9 installed and using a simple shell script. ... The second echo does not print, the cd command fails and quits the ...
    (comp.unix.solaris)