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"
'
来源:https://www.cnblogs.com/dylancao/p/9516237.html