SyntaxFix
Write A Post
Hire A Developer
Questions
This solution reads a single character and calls a function on a yes response.
read -p "Are you sure? (y/n) " -n 1 echo if [[ $REPLY =~ ^[Yy]$ ]]; then do_something fi