How to check if bash variable defined in script

I need to set a bash environment variable called PURGEIMAGE and take specific actions in my script. For example, if PURGEIMAGE set, then purge images from CDN else just URL. I am going to call my script as PURGEIMAGE=yes ./purgecache.sh url1 url2. So how do I know if a bash variable set at the CLI and used in my bash script running on Linux or Unix-like systems?

The post How to check if bash variable defined in script appeared first on nixCraft.



from nixCraft https://ift.tt/39y3C7D
via IFTTT

Post a Comment

0 Comments