printf 'Prompt for response: '
read -r response
# shellcheck disable=SC2312
if printf '%s\n' "${response}" | grep -Eq -- "$(locale yesexpr)"; then
  affirmative processing goes here ..
else
  non-affirmative ..
fi
