我编写了一个批处理文件,用于在游戏机不在身边时加载我的宝可梦备份,但是我现在转换到了Linux系统,我遇到了问题:将 .BAT 文件转换成 .SH 后无法正常工作(我已经从 .exe 文件反编译得到源代码)。而且我无法找到有关如何使用 Shell 命令与 BAT 文件中的相同功能的详细信息:/。我还想知道如何将 SH 文件设置为从当前目录加载,并在 Wine 中运行该程序。
这是我的 .BAT 文件,在 Windows 系统下可以完美地运行,但是在 Wine 或者 CMD 提示符下移植到 Wine 后就会拒绝运行:
`:MENU
CLS
ECHO ============= RawX GBA's =============
ECHO -------------------------------------
ECHO 1. Pokemon Crystal
ECHO 2. Pokemon Green
ECHO 3. Pokemon Gold
ECHO 4. Pokemon Pikachu
ECHO 5. Pokemon Ruby
ECHO 6. Pokemon Chaos Black
Echo 7. Pokemon Silver
ECHO 8. Pokemon White (NDS)
ECHO 9.
Echo 10.
Echo 11.
Echo 12. Pokemon Black (NDS)
ECHO ==========PRESS 'Q' TO QUIT==========
ECHO.
color fc
SET INPUT=
SET /P INPUT=Please select a number:
IF /I '%INPUT%'=='1' GOTO Selection1
IF /I '%INPUT%'=='2' GOTO Selection2
IF /I '%INPUT%'=='3' GOTO Selection3
IF /I '%INPUT%'=='4' GOTO Selection4
IF /I '%INPUT%'=='5' GOTO Selection5
IF /I '%INPUT%'=='6' GOTO Selection6
IF /I '%INPUT%'=='7' GOTO Selection7
IF /I '%INPUT%'=='8' GOTO Selection8
IF /I '%INPUT%'=='9' GOTO Selection9
IF /I '%INPUT%'=='10' GOTO Selection10
IF /I '%INPUT%'=='11' GOTO Selection11
IF /I '%INPUT%'=='12' GOTO Selection12
IF /I '%INPUT%'=='Q' GOTO Quit
CLS
ECHO ============INVALID INPUT============
ECHO -------------------------------------
ECHO Please select a number from the Main
echo Menu [1-9] or select 'Q' to quit.
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE > NUL
GOTO MENU
:Selection1
:1
".\VisualBoyAdvance.exe" ".\Pokemon Crystal.zip"
goto menu
:Selection2
:2
".\VisualBoyAdvance.exe" ".\Pokemon Green.zip"
goto menu
:Selection3
".\VisualBoyAdvance.exe" ".\Pokemon Gold.zip"
goto menu
:Selection4
".\VisualBoyAdvance.exe" ".\Poke'mon Pikachu.zip"
goto menu
:Selection5
".\VisualBoyAdvance.exe" ".\Pokemon Ruby.zip"
goto menu
:Selection6
".\VisualBoyAdvance.exe" ".\Pokemon - Chaos Black.zip"
goto menu
:Selection7
".\VisualBoyAdvance.exe" ".\Pokemon Silver.zip"
goto menu
:Selection8
".\desmume.exe" ".\PokeWhite.zip"
goto menu
:Selection12
".\desmume.exe" ".\PokeBlack.zip"
goto menu
:Quit
CLS
ECHO ==============THANK YOU===============
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE>NUL
EXIT`