Linux下Bash运行脚本 命令行应该这样写: sh -c "脚本字符串" example: sh -c "if ! type dpkg > /dev/null ; then echo 'some messages' fi"