Dos shell脚本运行shell脚本方法

                                      Dos shell脚本运行shell脚本方法

在实际开发中,经常会需要通过Windows操作系统下的*.bat文件运行*.sh shell脚本。下面将通过案例讲解该方法:

rem this is a dos shell script used to run a shell script
@echo "shell script"
:: the value of variable SHELL_SCRIPT_PATH is the path of python script
:: you need modify the content inside the dobule quotation depending on your demand
@set SHELL_SCRIPT_PATH="C:tool\Get_PS_data_script.sh"

:: shell bin directory
@set SHELL_BIN_DIR="C:\Program Files\Git\bin\bash.exe"
:: run shell script
@%SHELL_BIN_DIR% %SHELL_SCRIPT_PATH%

@echo "dos script run successfully"
@echo ~ ~  ~ ~  ~ ~
@echo  *    *    *
:: cmd command is used to keep reserve at dos windown if you run the bat
@cmd

猜你喜欢

转载自blog.csdn.net/yanlaifan/article/details/114968620