Skip to content

'#' as part of a quote should not be a comment #127

@naclsn

Description

@naclsn

Adding to the pile of incorrect comment parsing (see #41, #70, #116).

'#', when affixed to a quote or an expansion/substitution, should not delimit a comment, as in:

echo 'word'#not-comment
echo $(uname -a)#not-comment
echo `uname -a`#not-comment
echo $hey#not-comment
# ...

(ref.: Shell Command Language - rule 8).

This also seems to be the case for variable assignment:

var=#something
echo "'$var'" # -> '#something'

I couldn't tell from documentation if this is intended behavior, but it is for dash, bash and zsh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions