From owner-freebsd-bugs Wed Jan 31 18:20:19 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6012437B698 for ; Wed, 31 Jan 2001 18:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f112K1i73449; Wed, 31 Jan 2001 18:20:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DB2C337B503 for ; Wed, 31 Jan 2001 18:11:00 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f112B0C72590; Wed, 31 Jan 2001 18:11:00 -0800 (PST) (envelope-from nobody) Message-Id: <200102010211.f112B0C72590@freefall.freebsd.org> Date: Wed, 31 Jan 2001 18:11:00 -0800 (PST) From: larse@isi.edu To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/24769: tcsh: broken handling of comment in first line of shell script Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24769 >Category: bin >Synopsis: tcsh: broken handling of comment in first line of shell script >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 31 18:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Lars Eggert >Release: 4.2-RELEASE >Organization: >Environment: FreeBSD hbo.isi.edu 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Wed Jan 31 02:09:17 PST 2001 root@hbo.isi.edu:/usr/src/sys/compile/KERNEL-1.12 i386 >Description: Tcsh has a bug in 4.2-RELEASE when the first line of a shell script (which can contain the command interpreter, specified by #!) contains a comment that is not a valid command interpreter. In that case, tcsh will try to use the (non-existing) binary /usr/obj/usr/src/i386/bin/csh (which looks like it got hardwired during the 4.2 release buildworld). >How-To-Repeat: The following shell script demonstrates the problem: --snip-- # comment echo bar --snip-- [larse@hbo: ~] echo "# comment\necho bar" > bug && chmod +x bug && ./bug /usr/obj/usr/src/i386/bin/csh: No such file or directory. >Fix: Workaround: Don't put a comment in the first line of a shell script. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message