Cloudkul Support

Commenting out multiple lines in bash

In order to comment out multiple lines in bash, we can use bourne shell’s operator “:” and a pair of single quotes.

Let’s take an example of a bash script

Executing this script gives output as:

Now in order to comment out multiple lines, we place ” :  ‘ ” a line before the lines to be commented out and a  ” ‘ ” after the end of the lines as shown below:

After executing above shell script, output will be :

Is this article is helpful?

People like and 0 people dislike.

If result is not found or irrelevant, Please contact us.

Submit your request