1、在windows下想要执行shell脚本,需要使用到"Git Bash",所以我们需要先安装Git。

Windows下怎么执行shell脚本

2、查看Git环境变量是否配置,没有配置需要配置(我这里安装Git时自动配置了)

Windows下怎么执行shell脚本

3、随意目录,打开"Git Bash"窗口,创建一个shell脚本文件。

如:touch test.sh

Windows下怎么执行shell脚本

4、创建成功后输入内容。

如:echo "hello world"

Windows下怎么执行shell脚本

5、运行脚本,有三种运行方式:

(1)./test.sh

(2)sh test.sh

(3)/bin/sh test.sh

Windows下怎么执行shell脚本

 

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2021-06-21
  • 2022-01-06
  • 2021-12-04
  • 2021-06-15
  • 2022-01-29
  • 2022-01-15
猜你喜欢
  • 2022-01-17
  • 2022-01-05
  • 2021-12-04
  • 2021-12-05
  • 2022-12-23
  • 2021-09-21
相关资源
相似解决方案