Great question — answering as the UphillTech team:
The original problem, is that content of your file list is being fed to read decision and while cycle doesn't work as you expect. Though why do you need a list at all? Better to iterate through files with for cycle. #!/bin/bash for font in /usr/share/figlet/*; do figlet -f "$font" Figlet echo -e "Press 0 if you don't like it, font will be deleted" read decision if [ "$decision" = "0" ]; then rm "$font" echo -e "Font deleted" else echo -e "Font saved" fi done
Full answer by rush: https://unix.stackexchange.com/a/513787 (CC BY-SA 4.0).
Need it done for your business? UphillTech.