From owner-cvs-all Mon Aug 30 11:54:14 1999 Delivered-To: cvs-all@freebsd.org Received: from gndrsh.dnsmgr.net (GndRsh.dnsmgr.net [198.145.92.4]) by hub.freebsd.org (Postfix) with ESMTP id F0E0B157EF; Mon, 30 Aug 1999 11:54:07 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.9.3/8.9.3) id LAA66286; Mon, 30 Aug 1999 11:52:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <199908301852.LAA66286@gndrsh.dnsmgr.net> Subject: Re: cvs commit: src/bin/mkdir mkdir.1 mkdir.c In-Reply-To: <19990830082157.A89944@wopr.caltech.edu> from Matthew Hunt at "Aug 30, 1999 08:21:57 am" To: mph@astro.caltech.edu (Matthew Hunt) Date: Mon, 30 Aug 1999 11:52:32 -0700 (PDT) Cc: mark@grondar.za (Mark Murray), billf@jade.chc-chimes.com (Bill Fumerola), mharo@FreeBSD.org (Michael Haro), cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > On Mon, Aug 30, 1999 at 08:19:55AM +0200, Mark Murray wrote: > > > EG- A couple of years ago, someone wanted date(1) to not put a \n at > > the end of its output (for whatever reason), and he added a new -n > > flag to do it. Canonical UNIX method to do this is > > > > $ echo -n `date` > > Which is, of course, not quite the same as omitting the newline. > > The output of date(1) can contain multiple sequential spaces. After > being split into arguments, and recombined by echo(1), they'll be > reduced to one space. > > wopr:~$ date -r 800000 > Fri Jan 9 22:13:20 PST 1970 > wopr:~$ echo -n `date -r 800000`; echo > Fri Jan 9 22:13:20 PST 1970 > > Of course, I don't really have any need to get the output of date(1) > without the newline, but I could do something like this... > > wopr:~$ date -r 800000 | perl -pe 'chomp' > Fri Jan 9 22:13:20 PST 1970wopr:~$ Ever heard of ``IFS=''? Invoking perl to handle what can easily been done within the shell itself is expensive. -- Rod Grimes - KD7CAX - (RWG25) rgrimes@gndrsh.dnsmgr.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message