鍍金池/ 問答/Linux/ bash -c "command" 與command有何

bash -c "command" 與command有何區(qū)別?

terminal中,直接輸入command 和 輸入bash -c "command" 有何區(qū)別?

回答
編輯回答
厭遇

shell 有很多種的,bash -c 是為了保證命令使用 bash shell 來執(zhí)行。如果你使用的默認(rèn) shell 就是 bash 那么就沒有區(qū)別。

// 查看支持的 shell
cat /etc/shells 

// 查看正在使用的 shell
echo $SHELL
2017年1月24日 20:07