There exist shell scripts where comments have a space between the hash sign and the actual comment
# a comment at the beginning of a line
echo foo # a comment trailing after a command
and other that do not have one
#another comment at the beginning of a line
echo bar #another comment trailing after a command
Does this decision have some sort of impact on the actual execution of the scripts or is it (just) a coding style issue?
hashcommands
viaset -o hashcmds
for recent Bourne Shell versions, A line that starts with#something
is seens as a special command. But this only applies to the end of the file$HOME/.shrc
where this feature is usually enabled for interactive shells. The default for all scripts is disabled hash commands. BTW: hash commands include a method to edit shell aliases witout a need to quote the text.#
in order to be recognized as a comment marker:echo 3#foo
will print3#foo
not just3
.