Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2007 16:40:08 GMT
From:      Ricardo Nabinger Sanchez <rnsanchez@wait4.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/111711: cat(1) misbehaves with directories as parameters
Message-ID:  <200704171640.l3HGe8Z6081278@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/111711; it has been noted by GNATS.

From: Ricardo Nabinger Sanchez <rnsanchez@wait4.org>
To: Charlie ROOT <root@zeta.org.au>
Cc: freebsd-gnats-submit@freebsd.org, freebsd-bugs@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@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."



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