初识shell脚本
vim test.sh
#!/bin/bash echo "Hello World !"#!” 是一個約定的標記,它告訴系統(tǒng)這個腳本需要什么解釋器來執(zhí)行,即使用哪一種Shell。
?
chmod +x test.sh #使腳本具有執(zhí)行權限
./test.sh #執(zhí)行腳本,在當前目錄找,第一行必須是#!/bin/bash
/bin/sh test.sh #執(zhí)行腳本,在當前目錄找,不需要在第一行指定解釋器信息#!/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
轉(zhuǎn)載于:https://www.cnblogs.com/wwxbi/p/6160443.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結
- 上一篇: 困窘的近义词
- 下一篇: MariaDB 双主复制的配置