Question: (Closed) Converting the following batch script to linux shell
0
gravatar for User 6777
2.8 years ago by
User 677710
United States
User 677710 wrote:

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 cmd shell • 679 views
ADD COMMENTlink written 2.8 years ago by User 677710

Hello User 6777!

We believe that this post does not fit the main topic of this site.

Not a bioinformatics question.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

ADD REPLYlink written 2.8 years ago by Michael Dondrup46k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 680 users visited in the last hour