In my bash script, I want to take the response and make it lower case to anticipate and avoid errors.
However, when I convert to my response
to lower case, I can't seem to store that change in the variable.
How can I update the case of an input string and store such that I can compare it later?
#!/usr/bin/env bash -e
echo "To reset cluster on existing EKS cluster, we must first destroy the existing cluster."
read -p "Do you want to auto-approve the terraform destroy (y/n): " response
response="$response" | tr '[:upper:]' '[:lower:]'
echo $response
if [ $response = 'y' ]; then
echo "Destroy is auto-approved."
else
echo "Destroy is not auto-approved"
fi