From owner-freebsd-hackers Wed Jul 19 13:20:34 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id NAA08846 for hackers-outgoing; Wed, 19 Jul 1995 13:20:34 -0700 Received: from hemi.com (hemi.com [204.132.158.10]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id NAA08839 for ; Wed, 19 Jul 1995 13:20:31 -0700 Received: (from mbarkah@localhost) by hemi.com (8.6.11/8.6.9) id OAA10037 for hackers@freebsd.org; Wed, 19 Jul 1995 14:22:50 -0600 From: Ade Barkah Message-Id: <199507192022.OAA10037@hemi.com> Subject: Being curious with `cat * > file' To: hackers@freebsd.org Date: Wed, 19 Jul 1995 14:22:50 -0600 (MDT) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 2193 Sender: hackers-owner@freebsd.org Precedence: bulk Hello, What should `cat * > output` do ? Should it gracefully concatenate all the files together into a file called `output', or will it attempt to cat the output into itself so many times until the file system is filled ? In FreeBSD 2.0.5-950622-SNAP, the results are somewhat random: sometimes graceful, other times it fills up the file system. Is this a bug, feature, or is doing `cat * > output` considered an error ? The "problem" appears on two 2.0.5 machines here. Here's a sample session: [The particular shell is tcsh in my home directory. However, I can reproduce the problem with /bin/csh in /root (say, I just logged in as root.)] barkah: {1} mkdir test1 barkah: {2} cd test1 barkah: {3} cat >> testfile < output barkah: {5} ls -l total 4 -rw-rw-r-- 1 mbarkah userm 10 Jul 19 13:50 output -rw-rw-r-- 1 mbarkah userm 10 Jul 19 13:50 testfile [Looks great up to this point, works as expected] barkah: {6} cat * > output2 [Job killed with ctrl-c at this point] barkah: {7} ls -l total 916 -rw-rw-r-- 1 mbarkah userm 10 Jul 19 13:50 output -rw-rw-r-- 1 mbarkah userm 454360 Jul 19 13:50 output2 ^^^^^^ -rw-rw-r-- 1 mbarkah userm 10 Jul 19 13:50 testfile [Look how huge that output2 file is!] barkah: {8} tail -5 output2 test file test file test file test file test file [And now for some random info] barkah: {9} uname -a FreeBSD barkah.hemi.com 2.0.5-950622-SNAP FreeBSD 2.0.5-950622-SNAP #0: Wed Jul 12 19:10:26 MDT 1995 root@barkah.hemi.com:/usr/src/sys/compile/KERNEL i386 barkah: {10} df -k . Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/sd1s1f 1523098 533437 867813 38% /usr2 barkah: {11} grep usr2 /etc/fstab /dev/sd1s1f /usr2 ufs rw 1 1 barkah: {12} dmesg | grep aha0:1:0 (aha0:1:0): "HP 2.13 GB #A1 9002" type 0 fixed SCSI 2 sd1(aha0:1:0): Direct-Access 2033MB (4165272 512 byte sectors) Thanks for any ideas, -Ade Barkah -------------------------------------------------------------------- Inet: mbarkah@hemi.com - HEMISPHERE ONLINE - www: --------------------------------------------------------------------