- #!/path/to/shell [ argument ]
- where /path/to/shell might be /bin/sh, /usr/local/bin/bash
- This line is only interpreted by the operating system. That is,
- if a shell script (test.sh) is executable and run from the
- command line by typing its name and giving the script as an
- argument, as in
- $ sh test.sh
- then sh interprets test.sh. For sh, the shebang line is simply a
- comment, and is ignored $ sh test.sh
- 选择的解释器
- echo $SHELL
#!/path/to/shell [ argument ]
最新推荐文章于 2021-12-01 18:35:08 发布