QuestionQ171

VerifiedEssential Commands

In a shell script file, which character is used to begin a comment line?

Explanation

In POSIX-compliant shells (such as bash, sh, and ksh), the number sign '#' marks the start of a comment. Everything from '#' to the end of that line is ignored by the shell when executing the script, allowing developers to annotate code. This is documented in the bash manual under 'Comments'.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!