shell指令碼學習

來源:互聯網
上載者:User

標籤:

1、注釋
如果使用bash,則在指令檔頭注釋:#/bin/bash
2、將指令檔加上可讀與執行許可權,就可以使用./shell.sh來執行,也可以使用sh shell.sh的方式來直接執行,sh是bash的軟串連
3、test判斷語句用法
test -d Desktop && echo "is a dir" || echo "is not a dir"
尋找管道檔案:ll /dev | grep ‘^p‘,在dev目錄下,以p開頭的是管道檔案
永久連結:ln sh01.sh sh01-hard
4、if判斷語句
5、case語句
6、函數
7、while語句用法
8、for迴圈語句用法
9、until用法

shell指令碼學習

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.