Linux Bash Comments Inline or Outline

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-comments-inline-or-outline/
PINTEREST
PINTEREST
INSTAGRAM

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.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-comments-inline-or-outline/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Linux Command Not Found Error And Solution

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)