日本高清免费一本视频100禁_在线不卡欧美精品一区二区三区_国产一区二区好的精华液_中文综合在线_国产啊啊啊视频在线观看_大地资源网免费观看高清

IT之道-艾銻知道

您當前位置: 主頁 > 資訊動態 > 艾銻分享 >

服務器維護shell 腳本中的注釋詳解


2020-07-06 21:12 作者:admin

服務器維護shell 腳本中的注釋詳解

服務器維護小知識 單行注釋:
  單行注釋就比較簡單了,直接在行最前端加上符號 # 即可。具體用法如下所示:
# this is comment test
echo "this is comment test"
  運行結果:
?  comment git:(master) ? sh comment.sh
this is comment test
多行注釋:
  多行注釋有很多方法,這里就列舉幾個常用的
服務器維護小知識1 eof截止符
  eof截止符不但可以用作后續輸入命令,還可以用作注釋,常用用法:開始注釋部分:輸入::<<eof 結束部分:eof
  具體示例如下所示:
# echo is test
echo "test"
echo "test"
echo "test"
echo "test"
echo "test"
:<<eof
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
eof
  運行結果:
?  comment git:(master) ? bash comment.sh
test
test
test
test
test
 
服務器維護小知識2 感嘆號
 ?。√栆话阕鳛榍度雰热莶糠?,可以用作注釋,常用用法:開始注釋部分:輸入::<<! 結束部分:!
  具體示例如下所示:
# echo is test
echo "test"
echo "test"
echo "test"
echo "test"
echo "test"
:<<!
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
!
  運行結果:
?  comment git:(master) ? bash comment.sh
test
test
test
test
test
服務器維護小知識3 逗號
  逗號一般作區分內容,也可以用作注釋,常用用法:開始注釋部分:輸入:: ' 結束部分:' (注意,逗號和冒號之間要加空格)
  具體示例如下所示:
# echo is test
echo "test"
echo "test"
echo "test"
echo "test"
echo "test"
: '
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
echo "comment"
'
  運行結果:
?  comment git:(master) ? bash comment.sh
test
test
test
test
test
IT運維  我們選擇北京艾銻無限
以上文章由北京艾銻無限科技發展有限公司整理
 

相關文章

IT外包服務
二維碼 關閉
主站蜘蛛池模板: 抚顺市| 林芝县| 德兴市| 新乐市| 东兴市| 大理市| 云南省| 灵川县| 南靖县| 体育| 丹巴县| 洞口县| 博野县| 左贡县| 滁州市| 神池县| 阳谷县| 乌鲁木齐县| 深泽县| 西华县| 宜君县| 丰台区| 诏安县| 中山市| 织金县| 永昌县| 五峰| 无锡市| 贵德县| 米泉市| 吐鲁番市| 郧西县| 汨罗市| 阳新县| 宁德市| 民权县| 邯郸县| 兴业县| 乌兰浩特市| 长春市| 甘德县|