Syntax question

2007-03-24 Thread Caleb Cushing

sorry if this is an unwelcome question here... I recently reported a bug to
my distribution and was told it was not a bug. I'm wondering about the
standard behavior of comments in bash.

I've always been told that a comment start's with # and that everything
after it is a comment it.

the line
FEATURES="parallel-fetch ccache distlocks"# userfetch userpriv usersandbox

I was told my bug is not a bug because there was no space in between the "#

putting a space does fix the problem but I can't recall that I've ever seen
any documentation saying that mid line comments need a space before the #
(even if this might be good practice)

am I correct that it shouldn't matter? and it's the program interpreting the
file that is incorrect? (this program is probably written in python)

I'm not on the list please cc me.

--
Caleb Cushing
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Syntax question

2007-03-25 Thread Caleb Cushing

thx for the answer. I didn't realize my error, that white space defines the
separation of words, even when dealing with symbols. wish vim syntax
highlighted this stuff as the shell interprets because it sees it as a
comment. anyways like I said thanks for the explanation. I'm not going to
forget this lesson anytime soon.

On 3/25/07, Paul Jarc <[EMAIL PROTECTED]> wrote:


"Caleb Cushing" <[EMAIL PROTECTED]> wrote:
> the line
> FEATURES="parallel-fetch ccache distlocks"# userfetch userpriv
usersandbox
>
> I was told my bug is not a bug because there was no space in between the
"#
>
> putting a space does fix the problem but I can't recall that I've ever
seen
> any documentation saying that mid line comments need a space before the
#

man bash, in the section COMMENTS:
  a word beginning with # causes that word and all remaining
  characters on that line to be ignored

In your case, the # is not at the beginning of a word, so it doesn't
start a comment.  (Quotes don't separate words; a word can be partly
quoted and partly not.)


paul





--
Caleb Cushing
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash