Off topic:Converting the following batch script to linux shell
0
0
Entering edit mode
7.4 years ago
User 6777 ▴ 20

I am currently migrating to ubuntu from my windows system. Now I am learing to convert all my batch scripts into linux shell. Although the common commands are more or less similar, but I found it difficult for the following set of commands in windows cmd:

setlocal
:PROMPT
SET /P AREYOUSURE=USE Consensus Disorder Regions (Y) / User Selection (N):
IF /I "%AREYOUSURE%" NEQ "Y" GOTO FINISH1

echo              Options:
echo.
echo              1)    IUPRED(Long) + PONDR(VSL2b) + DisEMBL(REM465)
echo.
echo              2)    IUPRED(Long) + PONDR(VSL2b) + DisEMBL(COILS)
echo.
echo              3)    IUPRED(Long) + PONDR(VSL2b) + DisEMBL(HOTLOOPS)
echo.
echo              4)    IUPRED(Short) + PONDR(VSL2b) + DisEMBL(REM465)
echo.
echo              5)    IUPRED(Short) + PONDR(VSL2b) + DisEMBL(COILS)

CHOICE /C 12345 /M "Enter your choice:"

:: Note - list ERRORLEVELS in decreasing order

IF ERRORLEVEL 5 GOTO choice5
IF ERRORLEVEL 4 GOTO choice4
IF ERRORLEVEL 3 GOTO choice3
IF ERRORLEVEL 2 GOTO choice2
IF ERRORLEVEL 1 GOTO choice1

:choice1
perl script.pl input1.txt >> Output1.txt
GOTO End
:choice2
perl script.pl input2.txt >> Output2.txt
GOTO End
:choice3
perl script.pl input3.txt >> Output3.txt
GOTO End
:choice4
perl script.pl input4.txt >> Output4.txt
GOTO End
:choice5
perl script.pl input5.txt >> Output5.txt

:End


:FINISH1
endlocal
....
Next scripts..
...

These commands first prints few options, takes user choice and execute one perl script according to user choice. I notice a function called "setlocale" in linux, but I don't understand how to use that in the above problem.

I appreciate all advice and suggestion.

Thanks

linux shell cmd • 1.3k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1959 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6