What is the difference between ./ and sh to run a script?

来源:互联网 发布:软件开发规划 编辑:程序博客网 时间:2024/06/06 02:55
  • sh is the command line interpreter (dash).
    Running sh my_script makes 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 running ruby my_script).


原创粉丝点击