Linux Bash Comments Inline or Outline – POFTUT

Linux Bash Comments Inline or Outline

Linux bash have a lot of different type of programming features. While using these features we can create very complex scripts or applications in bash. In order to take notes in a script we should use comments. Comments provides useful information for system administrators.

Comment Bash

In bash comments starts with # . In the following example comments can be easily seen that those comments start from beginning of the line. To the end of line all characters are interpreted as comment.

In Line Comments

We can start the comment other than begging. We can write our command and then start comment to the end of line.

Multi line Comments

We can use multi line comments line by line. Actually there is no special form we just put comments line by line like below.

Shell Specification

Most of the shell scripts starts with #!/bin/bash this may seem a comment but it is not. First two letters of a shell file is special. This line specifies the shell type or interpreter used while processing the file. So do not put any comment to this line.

LEARN MORE  Linux Bash Profile File Configuration with Examples

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)