bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sed newline


From: Aharon Robbins
Subject: Re: Sed newline
Date: Tue, 13 Dec 2005 06:25:21 +0200

In article <address@hidden> you write:
>I understand that sed is supposed to allow you to insert a newline via
>the s command, by putting backslash and an actual end of line in a
>script.
> 
>Here, it works under tcsh and sh, but not bash (which is the local
>default).
>With bash, for the script:
> 
>#!/bin/tcsh
^^^^^^^^^^^^

This is the key line. This causes the *kernel* to use /bin/tcsh
to run the program.

># test if sed can insert a newline.
>cat $* | sed 's/here/\
>here/g'

Here's what I get an interactive bash:

        $ sed 's/here/\
        > here/g'
        look here guys!         <--- my input
        look                    <--- sed output
        here guys!

If you change the #! line to reference /bin/bash or /bin/sh, you
shouldn't have any problems.

Arnold
-- 
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd.     arnold AT skeeve DOT com
P.O. Box 354            Home Phone: +972  8 979-0381    Fax: +1 206 350 8765
Nof Ayalon              Cell Phone: +972 50  729-7545
D.N. Shimshon 99785     ISRAEL




reply via email to

[Prev in Thread] Current Thread [Next in Thread]