-bash: ./test: Permission denied
報錯原因:沒有對該腳本又執行權限。
解決方法:
chmod +x ./test.sh #使腳本具有執行權限 chmod 777 test.sh #或者
Linux chmod +755和chmod +777 各是什么意思呢?
755 代表用戶對該文件擁有讀,寫,執行的權限,同組其他人員擁有執行和讀的權限,沒有寫的權限,其他用戶的權限和同組人員權限一樣。 777代表,user,group ,others ,都有讀寫和可執行權限。