From root@ai1.alaska.net  Sat Apr  6 20:20:41 2013
Return-Path: <root@ai1.alaska.net>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 1B1BC940
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Apr 2013 20:20:41 +0000 (UTC)
	(envelope-from root@ai1.alaska.net)
Received: from ai1.alaska.net (ai1.alaska.net [209.112.188.15])
	by mx1.freebsd.org (Postfix) with ESMTP id 4341FEC7
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Apr 2013 20:20:39 +0000 (UTC)
Received: (from root@localhost)
	by ai1.alaska.net (8.14.5/8.14.5) id r36KLfWL085499;
	Sat, 6 Apr 2013 11:21:41 -0900 (AKST)
	(envelope-from root)
Message-Id: <201304062021.r36KLfWL085499@ai1.alaska.net>
Date: Sat, 6 Apr 2013 11:21:41 -0900 (AKST)
From: Joe Public <root@ai1.alaska.net>
Reply-To: Joe Public <root@ai1.alaska.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Possible comment problem is /bin/sh
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         177673
>Category:       bin
>Synopsis:       sh(1): Possible comment problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jilles
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 06 20:30:00 UTC 2013
>Closed-Date:    Wed Jul 03 20:49:26 UTC 2013
>Last-Modified:  Wed Jul 03 20:49:26 UTC 2013
>Originator:     Joe Public
>Release:        FreeBSD 9.1-RELEASE i386
>Organization:
none
>Environment:
System: FreeBSD 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
/bin/sh comments in a script will attach to an adjacent string.
An simple example follows, but they also attach in assignments, etc.
This broke 4.11 scripts, so I know sh(1) has changed since then,
but I am not qualified to state whether the current or previous
behavior is correct.
>How-To-Repeat:
#!/bin/sh
echo 'a comment follows'#comment.

$ ./script
$ a comment follows#comment.
>Fix:
Requires someone knowledgeable with /bin/sh code.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: jilles 
State-Changed-When: Sun Apr 7 16:13:03 UTC 2013 
State-Changed-Why:  
I compiled stable/4 sh and it shows the same 

a comment follows#comment. 

as recent sh and all other Bourne-style shells I tried. POSIX is also 
clear that a '#' only begins a comment if it is at the start of a word. 
This means that it can be (in most cases) at the start of a line, after 
whitespace or after an operator such as ')' and '&&'. 

There is likely something different going on here. 

I notice that tcsh does begin a comment in your script. 


Responsible-Changed-From-To: freebsd-bugs->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Sun Apr 7 16:13:03 UTC 2013 
Responsible-Changed-Why:  
sh(1) is my area. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177673 
State-Changed-From-To: feedback->closed 
State-Changed-By: jilles 
State-Changed-When: Wed Jul 3 20:49:25 UTC 2013 
State-Changed-Why:  
Feedback timeout. I think this is not a bug in FreeBSD and have not 
received information to the contrary. Sorry it did not work out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177673 
>Unformatted:
