bin/111711: cat(1) misbehaves with directories as parameters
Ricardo Nabinger Sanchez
rnsanchez at wait4.org
Tue Apr 17 16:40:08 UTC 2007
The following reply was made to PR bin/111711; it has been noted by GNATS.
From: Ricardo Nabinger Sanchez <rnsanchez at wait4.org>
To: Charlie ROOT <root at zeta.org.au>
Cc: freebsd-gnats-submit at freebsd.org, freebsd-bugs at freebsd.org
Subject: Re: bin/111711: cat(1) misbehaves with directories as parameters
Date: Tue, 17 Apr 2007 13:37:49 -0300
On Tue, 17 Apr 2007 18:49:52 +1000 (EST)
Charlie ROOT <root at zeta.org.au> wrote:
> >> Description:
> > If a directory is passed to cat, it outputs its contents, (sometimes)
> > mangles the terminal, and may misbehave, like in the second run with ".
> > Makefile" as parameters.
>=20
> This is the expected behaviour. Directories are files, and directory fil=
es
> are readable except on broken file systems.
You mean UFS2? :)
% mount
/dev/ad1s3a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad1s2d on /home (ufs, local, soft-updates)
/dev/ad1s3d on /tmp (ufs, local, soft-updates)
procfs on /proc (procfs, local)
(The test was under /home.)
Thanks for the info. In any case, cat do misbehave when both directories a=
nd
files are passed as parameters, as it doesn't cat anything else after the
directory:
% cat -n Makefile Makefile . Makefile Makefile
1 # @(#)Makefile 8.1 (Berkeley) 5/31/93
2 # $FreeBSD: src/bin/cat/Makefile,v 1.7 2001/12/04 01:57:37 obrien E=
xp
$ 3
4 PROG=3D cat
5
6 .include <bsd.prog.mk>
1 # @(#)Makefile 8.1 (Berkeley) 5/31/93
2 # $FreeBSD: src/bin/cat/Makefile,v 1.7 2001/12/04 01:57:37 obrien E=
xp
$ 3
4 PROG=3D cat
5
6 .include <bsd.prog.mk>
1 !g
.cat.1.gz=D9=E5=F8.=D8=F6/~...src/usr.bin/cat%
Regards.
--=20
Ricardo Nabinger Sanchez <rnsanchez@{gmail.com,wait4.org}>
Powered by FreeBSD
"Left to themselves, things tend to go from bad to worse."
More information about the freebsd-bugs
mailing list