Trying to write a script which will look at a demo license file on a system and when the expiration date is 5 days, 4-1 days and 0 days away send one of three different messages as an email notification to an external email address.
So far in my script script is able to look at the license file and grab the expiration date.
#! /bin/sh
vxlicense -p | grep "days from now" |awk '{print $ 10}'
...here I have a problem of the awk command grabbing a "(" character in front of my number so my output looks like (17.2
I would like to know if there is a way to awk just the numerical values and need code to compare the numerical value to 5, < than 5 & >0, and finally 0 or less. With each of these scenarios I will need to send one of three different email messages to an external email address.
This I believe I can accomplish using code that would look something like echo send this message | mailx -s text mailboss@this.com
please help me someone
So far in my script script is able to look at the license file and grab the expiration date.
#! /bin/sh
vxlicense -p | grep "days from now" |awk '{print $ 10}'
...here I have a problem of the awk command grabbing a "(" character in front of my number so my output looks like (17.2
I would like to know if there is a way to awk just the numerical values and need code to compare the numerical value to 5, < than 5 & >0, and finally 0 or less. With each of these scenarios I will need to send one of three different email messages to an external email address.
This I believe I can accomplish using code that would look something like echo send this message | mailx -s text mailboss@this.com
please help me someone