git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ia64 git pull

From
David A. Wheeler <dwheeler@dwheeler.com>
Date
Apr 22, 2005, 03:30 UTC
Message-ID
<42686FCA.2010605@dwheeler.com>
In-Reply-To
<17000.23588.462823.574142@sodium.jf.intel.com>
Petr Baudis <pasky@ucw.cz> writes:
>>Still, why would you escape it? My shell will not take # as a
>>comment start if it is immediately after an alphanumeric character.

I guess there MIGHT be some command shell implementation that stupidly _DID_ accept "#" as a comment character, even immediately after an alphanumeric. If that's true, then using # there would be a pain for portability.

But I think that's highly improbable. A quick peek at the Single Unix Specification as posted by the Open Group seems to say that, according to the standards, that's NOT okay: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02 Basically, the command shell is supposed to tokenize, and "#" only means comment if it's at the beginning of a token.

And as far as I can tell, it's not an issue in practice either. I did a few quick tests on Fedora Core 3 and OpenBSD. On Fedora Core 3, I can say that bash, ash & csh all do NOT consider "#" as a comment start if an alpha precedes it. The same is true for OpenBSD /bin/sh, /bin/csh, and /bin/rksh. If such different shells do the same thing (this stuff isn't even legal C-shell text!), it's likely others do too.

--- David A. Wheeler
Previous: Inaky Perez-Gonzalez
Message 4 of 4 in “Re: ia64 git pull”
  1. Petr BaudisApr 21, 2005
  2. Petr BaudisApr 22, 2005
  3. Inaky Perez-GonzalezApr 22, 2005
  4. David A. WheelerApr 22, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.