Fork me on GitHub

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"
'

posted on 2018-08-22 10:41  虚生  阅读(44399)  评论(2编辑  收藏  举报