Thursday, 8 August 2013

Matching only the first three numbers of a string in ksh

Matching only the first three numbers of a string in ksh

VARIABLE=grep PortNumber testfile.txt | awk -F'"' '{print $2}'` echo
$VARIABLE 33111
I want to do a check to ensure the first 2 numbers of the variable are the
digit '3' only.
How can I do this using a standard ksh script?
Thanks in advance.

No comments:

Post a Comment