开发者

Convert .bat file to .sh file

I have to convert the following .bat code in the .sh code :

@ECHO OFF
REM Checking necessary files
SET "PHP_BIN=C:\Program Files\xampp\php\php.exe"
SET "PHP_RUN_FILE=user_integration.php"
SET "WWW_DOCUMENT_ROOT=C:\moodle\server\moodle"
SET "PHP_INI=C:\Program Files\xampp\php\php.ini"
SET "WWW_RUN_FILE=%WWW_DOCUMENT_ROOT%\batch\user_integration\%PHP_RUN_FILE%"
IF NOT EXIST "%PHP_BIN%" GOTO :PHP_BIN_NOT_INSTALLED 
IF NOT EXIST "%WWW_RUN_FILE%" GOTO :WWW_RUN_FILE_NOT_INSTALLED
GOTO :RUN
:PHP_BIN_NOT_INSTALLED
ECHO %PHP_BIN% does no开发者_运维问答t exist
REM GOTO :END
:WWW_RUN_FILE_NOT_INSTALLED
ECHO %WWW_RUN_FILE% does not exist
REM GOTO :END
:RUN
"%PHP_BIN%" -c "%PHP_INI%" -f "%WWW_RUN_FILE%"
pause
REM GOTO :END
:END
@ECHO ON

Please help, thank you.


How about:

#!/bin/sh
/usr/bin/php -i /path/to/php.ini -f /path/to/user_integration/user_integration.php
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜