1. Home
  2. Bash
  3. Bash Tutorial
  4. Bash – Comments

Bash – Comments

Comments in Bash

Comments are an essential part of any programming language. It is used to describes the uses of any code or functions. Same as the most of programming language bash scripts also support two types of comments. Single line comment and multi-line comment.

Bash Single Line Comment

Single line comments are started with a hash (#) symbol.

Bash Multiple Line Comment

You can also use multi-line comments in bash scripts. There are two ways to do this. Read below example script, shows both ways of multi-line comments.

The first comment started with <<ANYSTRING and ends with same string ANYSTRING. The second multi line comments started with : ' and ended with single quote ' only.

Was this article helpful to you? Yes 12 No 1