shell 中的单行注释和多行注释

1. 单行注释

众所周知,#  比如想要注释:echo “ni”

# echo "ni"

2. 多行注释:

法一:

: << !

语句1

语句2

语句3

语句4

!

例如:

linux101:/home/wsj # sh dian
ni
ni
ni
ni
ni
ni

linux101:/home/wsj # more dian
#!/bin/ksh
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"

:<<!
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
!

法二:

: '

语句1

语句2

语句3

语句4

'

例如:

linux101:/home/wsj # sh dian
ni
ni
ni
ni
ni
ni

linux101:/home/wsj # more dian
#!/bin/ksh
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"

: '
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
echo "ni"
'

上一篇:使用 history 对象和 location 对象中的属性和方法制作一个简易的网页浏览工具


下一篇:运维DBA要不要学python