相关疑难解决方法(0)

执行shell脚本的不同方式

有几种方法可以执行脚本。我知道的有:

/path/to/script # using the path (absolute or relative)
. script        # using the . (dot)
source script   # using the `source` command
Run Code Online (Sandbox Code Playgroud)

有没有其他办法?它们之间有什么区别?在某些情况下,我必须使用一种而不是另一种吗?

executable shell-script

45
推荐指数
3
解决办法
7万
查看次数

标签 统计

executable ×1

shell-script ×1