« Return to Thread: Shell script - insert newline into string

Re: Re: Shell script - insert newline into string

by Brendon Oliver-2 :: Rate this Message:

Reply to Author | View in Thread

On Mon, 15 Jun 2009 03:53:17 am Tony Wilson wrote:

> That works from the command line, but not in script!
>
> string=`echo -e "A\nB\nCDE\nF"`
> echo $string
>
> output:
> A B CDE F

You might be picking up the shell's built-in echo.  Try /opt/bin/echo instead
(using unslung here, so you may need to adjust the path if you have something
different).

- b.

--

 06:17:38 up 3 days, 19:48,  6 users,  load average: 1.12, 0.50, 0.18




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nslu2-linux/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nslu2-linux/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:nslu2-linux-digest@...
    mailto:nslu2-linux-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nslu2-linux-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

 « Return to Thread: Shell script - insert newline into string