Linux Shell Scripting Tutorial Series (4) Shell Notes

This article is the fourth part of the Linux Shell Scripting Series . For more shell tutorials, please see: Linux Shell Scripting Series Tutorials

Like many programming languages, there are also comment symbols in Shell. Following the previous article , today I will introduce the syntax and usage of comments in Shell.

Comments in the shell begin with a "#" sign, and all code beginning with a "#" sign will be ignored by the interpreter.

For example the following code:

#!/bin/bash
# Author : justcode.ikeepstudying.com
# Date : 2016-05-15
echo "What is your name?"
read PERSON
echo "Hello, $PERSON"

 

The Author field and Date field beginning with "#" are comments in Shell.

And there are no multi-line comments in Shell, only single-line comments, so there is only one way to comment code.

 

Original: Linux Shell Series Tutorial (4) Shell Notes

This article is transferred from: Linux Shell Scripting Tutorial Series (4) Shell Notes

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326635212&siteId=291194637