mercredi 6 janvier 2016

Test if output of bash command contains a certain string; run another command if so

I'm kind of a bash noob, so please make it easy to understand:)
Every day, I get a "Coin" for logging in and answering a question.
I want to write a bash script that:
1.Runs the command bux
2A.If the output of bux contains have, do nothing
2B.If the output of bux contains X, run the command Y
2C.If the output of bux contains Z, run the command A
*It will only contain ONE of these things, not multiple *I want to add this to my .bash_profile, if possible
Thanks Soooo much for helping!!!!

Aucun commentaire:

Enregistrer un commentaire