初识shell脚本
vim test.sh
#!/bin/bash echo "Hello World !"#!” 是一個約定的標記,它告訴系統這個腳本需要什么解釋器來執行,即使用哪一種Shell。
?
chmod +x test.sh #使腳本具有執行權限
./test.sh #執行腳本,在當前目錄找,第一行必須是#!/bin/bash
/bin/sh test.sh #執行腳本,在當前目錄找,不需要在第一行指定解釋器信息#!/bin/bash
?
vim test1.sh
#!/bin/bash # Author : wx # Date : echo "What tools are you using?" read tool echo "Hello, $tool"
$ sh /home/wx/test1.sh
What tools are you using?
shell
Hello, shell
轉載于:https://www.cnblogs.com/wwxbi/p/6160443.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
- 上一篇: 困窘的近义词
- 下一篇: MariaDB 双主复制的配置