From owner-freebsd-bugs Fri May 24 06:28:00 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA02084 for bugs-outgoing; Fri, 24 May 1996 06:28:00 -0700 (PDT) Received: from itsdsv1.enc.edu (itsdsv1.enc.edu [199.93.252.241]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA02071 for ; Fri, 24 May 1996 06:27:57 -0700 (PDT) Received: from dingo.enc.edu (dingo.enc.edu [199.93.252.229]) by itsdsv1.enc.edu (8.6.12/8.6.9) with SMTP id JAA28808 for ; Fri, 24 May 1996 09:27:25 -0400 Date: Fri, 24 May 1996 09:27:26 -0400 (EDT) From: Charles Owens Reply-To: Charles Owens To: bugs list FreeBSD Subject: bug in awk Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Awk seems to have a problem, perhaps associated with the use of the FS variable. (Bug seen with FreeBSD 2.1-stable a la 3/16/96) Allow me to demonstrate: I have a directory with the following files : crc.doc minirb.doc rz.doc sz.doc I want to remame them to foo.1 and stick them in /usr/local/man/cat1. Accordingly, I do the following (which ultimately would be piped to a shell, of course): ls -1 *.doc \ | awk '{FS="."; print "cp " $1 ".doc /usr/local/man/cat1/" $1 ".1" }' This produces: cp crc.doc.doc /usr/local/man/cat1/crc.doc.1 cp minirb.doc /usr/local/man/cat1/minirb.1 cp rz.doc /usr/local/man/cat1/rz.1 cp sz.doc /usr/local/man/cat1/sz.1 Note the problem that the first line has. This behavior is repeatable, using different field separators, etc. I'm no awk expert, but it sure looks like a bug to me... --- ------------------------------------------------------------------------- Charles Owens Email: owensc@enc.edu "I read somewhere to learn is to Information Technology Services remember... and I've learned that Eastern Nazarene College we've all forgot..." - King's X -------------------------------------------------------------------------