Grep. Driving myself Insane.
I am running a command that looks like this:
Code:
./ssl-cert-check.sh -s oc.mydomain.com -p 443 Code:
Host Status Expires Days I have been unsuccessful using the following bash command Code:
./ssl-cert-check.sh -s oc.visionsxtreme.com -p 443|grep '/([0-9])+$/m' Thank you. Ben |
Over thinking it way too much - try "grep -oE '[0-9]+$' ".
|
Thank you, but running the following command still does not produce any output.
Code:
./ssl-cert-check.sh -s oc.mydomain.com -p 443|grep -oE '([0-9])+$' |
The reason for things like that is generally whitespace at end of line - add it to your regex.
|
Thank you, I should have realized some white space may have existed. The following worked:
Code:
./ssl-cert-check.sh -s oc.mydomain.com -p 443|grep -oE '([0-9])+ *$' |
A little longer, but this type of thing is well suited to awk:
Code:
./ssl-cert-check.sh -s oc.mydomain.com -p 443 | awk '/[0-9]/{print $NF}' |
All times are GMT -5. The time now is 05:49 AM. |