02-script.sh (625B)
1 #!/bin/sh -e 2 3 # After execution, the script sources are displayed 4 5 printf "\e[?1049h\e[2J\e[0;0H" # Switch buffer, clear screen and mv cursor 6 7 printf "Scripts\n" 8 printf "=======\n\n" 9 printf "‣ Use scripts to invoke third-party programs and do fancy things\n\n" 10 printf "‣ This slide is currently a script that gives you the choice\n" 11 printf " of printing the diaposishell man page or not\n\n" 12 13 while true; do 14 printf " Print diaposishell man page? [y/n] " 15 16 read -r c 17 case "${c}" in 18 "y") man ./diaposishell.1 && break;; 19 "n") break;; 20 *) continue;; 21 esac 22 done 23 24 printf "\e[?1049l" # Restore main buffer