Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2002 21:34:57 +1300
From:      Jonathan Chen <jonc@chen.org.nz>
To:        BSD Freak <bsd-freak@mbox.com.au>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Newline character doesn't work
Message-ID:  <20021212083457.GA34890@grimoire.chen.org.nz>
In-Reply-To: <c42a6dc3ea00.c3ea00c42a6d@mbox.com.au>
References:  <c42a6dc3ea00.c3ea00c42a6d@mbox.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 12, 2002 at 07:14:28PM +1100, BSD Freak wrote:
> Hi guys,
> 
> Just tried the following and it doesn't seem to work.. any explanations?
> 
> %echo first line \\n second line
> 
> Output is: 
> first line \n second line

According to the man-page, echo(1) is working as advertised. What you
want is printf(1).

    $ printf "first line\nsecond line\n"
    first line
    second line

-- 
Jonathan Chen <jonc@chen.org.nz>
----------------------------------------------------------------------
                                  Computers are like air conditioners.
                              They stop working when you open Windows.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021212083457.GA34890>