Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Sep 2001 06:10:34 +0300
From:      Giorgos Keramidas <charon@labs.gr>
To:        Jamie Bowden <ragnar@sysabend.org>
Cc:        chat@FreeBSD.ORG
Subject:   Re: cat(1) strangeness when '-' and options are combined
Message-ID:  <20010908061034.A19365@hades.hell.gr>
In-Reply-To: <20010908055755.A16153@hades.hell.gr>; from charon@labs.gr on Sat, Sep 08, 2001 at 05:57:56AM %2B0300
References:  <20010908010405.A13448@hades.hell.gr> <Pine.BSF.4.10.10109071914420.41287-100000@moo.sysabend.org> <20010908055755.A16153@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Giorgos Keramidas <charon@labs.gr>
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 <ragnar@sysabend.org>
> 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




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