tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ SED PROBLEM

Using sed on /etc/group ▻

Using n

In article <Mk2jODKXwU9q7jZpIOUP81=SEgzt@4ax.com>,
Antonnetje M. Rolfes  <arolfes@dds.nl> wrote:
>echo " hi there,\n anybody has a solution?"

Oh my god!  They killed `echo'.

This is one of the tragedies of Unix.  The Solaris echo(1) man page
describes the four *different* flavours of `echo' to be found on the
system.  Two of these further change their behaviour depending upon the
setting of an environment variable.

The GNU / bash `echo' is different from all of those.

In the particular example you quote, there is an easy solution.

    echo " hi there,"
    echo " anybody has a solution?"

For more complicated cases, I recommend using printf(1) instead.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Using \n (newline) in Bash
Date: 11 Feb 2000 10:49:25 -0000
Message-ID: <880pgb$46c$1@ltpcg.star.le.ac.uk>
References: <Mk2jODKXwU9q7jZpIOUP81=SEgzt@4ax.com>

△ comp.unix.shell △

◅ SED PROBLEM

Using sed on /etc/group ▻