2011-03-23 114 views
0

我有以下.BAT代碼轉換在.SH代碼:轉換.bat文件到sh文件

@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 not 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 

請幫忙,謝謝。

回答

1

如何:

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