Skip to content

Instantly share code, notes, and snippets.

@odadoda
Created March 7, 2014 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odadoda/9410884 to your computer and use it in GitHub Desktop.
Save odadoda/9410884 to your computer and use it in GitHub Desktop.
The loop in zab
## 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