-
shis the command line interpreter (dash).
Runningsh my_scriptmakes dash interpret the script. -
./tries to find out which interpreter to use, by looking at the first line. E.g.#!/bin/bash, or even#!/bin/ruby(as oppsed to runningruby my_script).
What is the difference between ./ and sh to run a script?
最新推荐文章于 2025-09-05 16:26:29 发布
本文探讨了如何使用命令行解释器(dash)来运行脚本,介绍了如何通过查看脚本的第一行来确定使用的解释器,例如 `#!/bin/bash` 或者 `#!/bin/ruby`。文章详细解释了如何在不同解释器之间进行选择,并提供了实际操作的示例。
1143

被折叠的 条评论
为什么被折叠?



