From owner-freebsd-chat Fri Sep 7 20:10:31 2001 Delivered-To: freebsd-chat@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id DC01337B408 for ; Fri, 7 Sep 2001 20:10:10 -0700 (PDT) Received: from hades.hell.gr (patr530-b024.otenet.gr [195.167.121.152]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id f883A7A20203; Sat, 8 Sep 2001 06:10:07 +0300 (EEST) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id f883AYu19484; Sat, 8 Sep 2001 06:10:35 +0300 (EEST) (envelope-from charon@labs.gr) Date: Sat, 8 Sep 2001 06:10:34 +0300 From: Giorgos Keramidas To: Jamie Bowden Cc: chat@FreeBSD.ORG Subject: Re: cat(1) strangeness when '-' and options are combined Message-ID: <20010908061034.A19365@hades.hell.gr> References: <20010908010405.A13448@hades.hell.gr> <20010908055755.A16153@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010908055755.A16153@hades.hell.gr>; from charon@labs.gr on Sat, Sep 08, 2001 at 05:57:56AM +0300 X-PGP-Fingerprint: 3A 75 52 EB F1 58 56 0D - C5 B8 21 B6 1B 5E 4A C2 X-URL: http://students.ceid.upatras.gr/~keramida/index.html Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org From: Giorgos Keramidas Subject: Re: cat(1) strangeness when '-' and options are combined Date: Sat, Sep 08, 2001 at 05:57:56AM +0300 Replying to own post, after doing an extra bit of research. > From: Jamie Bowden > Subject: Re: cat(1) strangeness when '-' and options are combined > Date: Fri, Sep 07, 2001 at 07:16:16PM -0700 > > If you invoke cat like this: > > % cat - /etc/fstab - > > If at least one option is given to cat though before the first '-', ... > > % cat -n - /etc/fstab - > > I am going to have access to a GNU/Linux box in a few minutes, and > test it there too with their getopt() and cat. As I suspected, the behavior of Linux utils on these two commands is different. In both cases, cat reads data from stdin *twice*, expecting two ^D presses to finish successfully. On the other hand, the two commands shown above, behave exactly like FreeBSD when they are executed in Solaris 7 running on a sun4u machine that I could ssh to. Ok, now I really need some sleep and a cup of strong black coffee. Or someone to point me in the correct direction, be it "you are wrong for [this] and [that] reason", or "hmmm, this is truly weird, fix it yourself and make it behave [this] or [that] way and send us a patch". -giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message