Created
March 7, 2014 12:50
-
-
Save odadoda/9410884 to your computer and use it in GitHub Desktop.
The loop in zab
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
## wait for input | |
read -n 1 -s INPUT | |
# Valid input: | |
# | |
# m: next line / slide | |
# n: previous slide | |
# q: quit presenter | |
while [ "$INPUT" != "q" ]; do | |
case "$INPUT" in | |
( "m" ) | |
next;; | |
( "n" ) | |
prev;; | |
( "*" ) | |
echo "wtf";; | |
esac | |
if [ "$current_row" '<' 0 ] ; then | |
current_row=0 | |
fi | |
if [ "$current_row" -gt "$file_lines_count" ] ; then | |
current_row=$file_lines_count | |
fi | |
# next input | |
read -n 1 -s INPUT | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment