Comments in Shell Script

bash

There are two types of comments:

  1. Single-line comment
  2. Multi-line comment

Single-line comments

Use # in the begining of the line to comment that single line.

1
# this is a comment.

Multi-line comment

  • Add : ‘ in the start.
  • Add ‘ at the end.
1
2
3
4
5
6
#!/bin/bash
: '
This is
multiline comment
in shellscript
'

Our Top Rated Host

Related Posts