How to write comments in Bash
In this post we will give you information about How to write comments in Bash. Hear we will give you detail about How to write comments in BashAnd how to use it also give you demo for it if it is necessary.
we are going to learn about how to write the comments in Bash with the help of examples.
Comments helps us to understand the code better, in case if we forgot what is happening on the particular line of code.
Comments are ignored by the interpreter.
There are two ways to write comments in Bash.
Single line comment
To we can write a single line comment in Bash, we can use the forward slashes # followed by the comment.
Here is an example:
# this is a single-line comment in bash
Anything we written after # is ignored by the compiler.
Multiline comments
To write a multiline comments, we can use the : ‘ and ‘ syntax in Bash.
Here is an example:
: 'you cansee meein multiple lines'
In the above example, the multiline comment starts after the : ‘ and ends at ‘.
Or you can write a muliline comment like this:
<<COMMENT This is a multiple line comment in BashCOMMENT
Hope this code and post will helped you for implement How to write comments in Bash. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs