DEV Community


bash script - Check if environment variable was set.

dnsmnds profile image Dênis Mendes ・1 min read

Here's how you check if a environment variable was set using a bash script:


if [ -z "$AWS_ACCESS_KEY_ID" ]; then
  echo "You need to set AWS credentials! Check out the project documentation."
Enter fullscreen mode Exit fullscreen mode

This script is working on macOS Catalina.

Discussion (0)

Forem Open with the Forem app