From owner-freebsd-questions Thu Dec 12 0:35:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C85E37B404 for ; Thu, 12 Dec 2002 00:35:17 -0800 (PST) Received: from chen.org.nz (chen.org.nz [210.54.19.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id B910543E4A for ; Thu, 12 Dec 2002 00:35:16 -0800 (PST) (envelope-from jonc@chen.org.nz) Received: from grimoire.chen.org.nz (localhost [127.0.0.1]) by chen.org.nz (8.12.6/8.12.6) with ESMTP id gBC8YvXJ034932; Thu, 12 Dec 2002 21:34:57 +1300 (NZDT) (envelope-from jonc@grimoire.chen.org.nz) Received: (from jonc@localhost) by grimoire.chen.org.nz (8.12.6/8.12.6/Submit) id gBC8YvKd034931; Thu, 12 Dec 2002 21:34:57 +1300 (NZDT) (envelope-from jonc) Date: Thu, 12 Dec 2002 21:34:57 +1300 From: Jonathan Chen To: BSD Freak Cc: FreeBSD Questions Subject: Re: Newline character doesn't work Message-ID: <20021212083457.GA34890@grimoire.chen.org.nz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 ---------------------------------------------------------------------- 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