Batch to Bash
Posted on 2005-03-06
I would like to translate this to a bash script.
The current Windows batch script is:
ECHO AP Biology Lab Selector
ECHO Lab 2: Enzyme Catalysis
ECHO Q to Quit
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET /P Choice=Type lab number:
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='2' GOTO Item1
IF /I '%Choice%'=='Q' GOTO End
IF /I '%Choice%'=='Quit' GOTO End
ECHO "%Choice%" is not valid!
ECHO Starting program...
Any help would be great.