Quantcast
Channel: nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED)
Viewing all articles
Browse latest Browse all 2621

How to declare Boolean variables in bash and use them in a shell scriptnixCraft

$
0
0

I need to define a bash variable called failed and set the value to False. When my script is called from a cron job, specific tasks might fail, and then I need to flip failed to True. Based upon $failed, I need to send an email alert that my cron job has failed. So how can I declare and use Boolean variables in a shell script running on a Linux server?

The post How to declare Boolean variables in bash and use them in a shell script appeared first on nixCraft.


Viewing all articles
Browse latest Browse all 2621

Trending Articles