From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 17 16:40:08 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93B6116A46B for ; Tue, 17 Apr 2007 16:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 83D9813C43E for ; Tue, 17 Apr 2007 16:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3HGe88U081280 for ; Tue, 17 Apr 2007 16:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3HGe8Z6081278; Tue, 17 Apr 2007 16:40:08 GMT (envelope-from gnats) Date: Tue, 17 Apr 2007 16:40:08 GMT Message-Id: <200704171640.l3HGe8Z6081278@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ricardo Nabinger Sanchez Cc: Subject: Re: bin/111711: cat(1) misbehaves with directories as parameters X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ricardo Nabinger Sanchez List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2007 16:40:08 -0000 The following reply was made to PR bin/111711; it has been noted by GNATS. From: Ricardo Nabinger Sanchez To: Charlie ROOT 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 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 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 1 !g .cat.1.gz=D9=E5=F8.=D8=F6/~...src/usr.bin/cat% Regards. --=20 Ricardo Nabinger Sanchez Powered by FreeBSD "Left to themselves, things tend to go from bad to worse."