Re: Sed replace doesn't work from shell script

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 07/26/05


Date: Tue, 26 Jul 2005 08:21:34 -0500

takarov2003@yahoo.com 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.
>

It's not obvious what the problem is and since this is the wrong NG
anyway, I'm setting followups to comp.unix.shell (which you should use
in future for sed questions).

        Ed.



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)
  • 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.lang.awk)
  • 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: 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)