开发者

why is the line #!/bin/ksh is the first line in a shell script

开发者 https://www.devze.com 2022-12-27 06:18 出处:网络
#!/bin/ksh is the first line in a shell scr开发者_如何学Goipt always what is the importance of this line and why is it kept as the first line.This line tells the operating system what interpreter to

#!/bin/ksh is the first line in a shell scr开发者_如何学Goipt always

what is the importance of this line and why is it kept as the first line.


This line tells the operating system what interpreter to invoke to run the script.

Without it, there's no way to know that this script needs to be run using the ksh interpreter.

The sequence is known as a "shebang", and you can read more about it on Wikipedia.


If the file is executable, it tells the os, which program can execute the script.


it signals that the script is to be executed by ksh (instead of any of the other shells)

0

精彩评论

暂无评论...
验证码 换一张
取 消