Created
July 13, 2012 20:10
-
-
Save noahlz/3107114 to your computer and use it in GitHub Desktop.
Attempt to code eval loop in sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Futile attempts keep BUG below to not potentially exit the script. | |
set +e +E | |
trap '' ERR | |
# displays the prompt in light cyan. | |
# TODO: http://stackoverflow.com/q/6788777/7507 | |
echo -e "\e[00;36mEnter expressions, [Ctrl-C] to exit\e[00m" | |
while : | |
do | |
echo -en "\e[00;36m=> \e[00m" | |
read expression | |
# BUG: If the expression is invalid, exits the script | |
echo $((${expression})) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment