
Ich bin auf der Suche nach dem foo
Inhalt von:
$ echo blah && foo && echo the sequel
blah
Do you want to continue? [y/n]: n
$ echo blah && foo && echo the sequel
blah
Do you want to continue? [y/n]: y
blah
$
Antwort1
Standard? Nein.
Du könntest es tun
foo() {
local answer
while true; do
read -p "Do you wish to continue? [y/n]: " answer
case $answer in
[yY]*) return 0 ;;
[nN]*) return 1 ;;
esac
done
}