1、創建test.sh文件
touch test.sh
2、編輯sh文件
vi test.sh(i:插入 | esc:退出insert模式 | wq+回車:退出)
3、保存退出
敲擊esc, 然后輸入 :wq ,回車退出
4、添加可執行權限,當然默認就是可執行的。
chmod +x test.sh
5、運行文件
(2)sh test.sh
rm test.sh
6 、sh中的注釋:#
二 linux中echo命令的換行方法:
echo -e "text1\ntext2"
輸出結果
text1
text2