read -r -p "Are you sure? [Y/n]" response response=${response,,} # tolower if [[ $response =~ ^(yes|y| ) ]] # if|| only[[ press-z Enter$response we]]; needthen detect this condiction your-action-here fi fixed if statement and optional "||" instead of pipe "|" - Actually this answer is already here: https://stackoverflow.com/a/16508612/2571881
SergioAraujo
- 12k
- 3
- 52
- 45