Ask For Input Until Y Or N Pressed

Pavol Kutaj
Jan 13, 2022

--

The aim of this page📝is to show a pattern usable for getting a simple single-character input from a user. Taken from

https://www.pluralsight.com/courses/bash-shell-scripting

…which I can only recommend as it is guiding me through first scripting task at my work.

1. notes

  • note that without -s you would get a line of output such as
Are you sure (Y/N)? abdsdvcy
yes

--

--

No responses yet