+snippet choice "Read a choice from stdin" b
+read -r -p "${1:Question?} [Yn] " choice
+case "$choice" in
+ Y|y) echo "yes" ;;
+ '') echo "yes" ;;
+ N|n) echo "no" ;;
+ *) echo "invalid"
+esac
+endsnippet
+
+snippet readline "Read a file line by line" b
+while ${1:IFS='' }read -r ${2:line} || [[ -n "$$2" ]]; do
+ ${0:echo "Text read from file: $$2"}
+done < "\$${3:file}"
+endsnippet
+