syntax

Bash Shell comments

An unquoted # beginning a word in a noninteractive script starts a comment. Quoted or embedded # is literal.

Formal Syntax & Structure

bash syntaxbash
# comment

Return Value

behavior

See the syntax and description for shell interpretation or output.

Working Example

Example Snippetbash
printf '%s\n' item#7 # commentprintf '%s\n' '#7'
Bash Reference