[NTLUG:Discuss] basic Bash question
fredjame
fredjame at fredjame.cnc.net
Tue Aug 3 10:25:43 CDT 2004
Lance Simmons wrote:
>I need to test whether a string is an integer.
>
>I'm tailing a logfile and extracting a string. 99 times out of 100 the
>string is an integer, but sometimes, because of the program that creates
>the logfile, it's not an integer.
>
>Is there a simple way in a bash script to test whether a string is an
>integer?
>
I'm thinking pipe the string trough awk or grep, but there may be an
easier way.
--
...we are fellow passengers...
More information about the Discuss
mailing list