Starting of bash script
问题 What is reason behind writing #! /bin/bash at the very starting of every bash script ? I means, I know that it is kind of hack but I want to know how it exactly works ? 回答1: If you call the script with an explicit interpreter, like bash foo.sh /bin/bash foo.sh dash foo.sh sh foo.sh your choosen interpreter is used, no matter what the shebang says, which is just a comment. If you make the script executable, and start it: chmod a+x foo.sh ./foo.sh the kernel looks for the shebang and starts the