bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shell comment ignored


From: Keith Clifford
Subject: Shell comment ignored
Date: Thu, 16 Aug 2012 17:36:45 -0700

Hi,

I first noticed this in a shell script under mingw but tested it in bash
under Linux and it has the same behaviour.

 

some_var=# What I thought was a comment.

 

The '#' is eaten by the variable assignment so that some_var gets a null
value and the rest of the line is not treated like a command.

 

If there is no space after the '#':

 

some_var=#What

 

Then some_var is set to '#What'.

 

Regards,

Keith Clifford.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]