[NTLUG:Discuss] basic Bash question

Lance Simmons lance at lsimmons.net
Tue Aug 3 10:10:02 CDT 2004


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?

-- 
Lance Simmons



More information about the Discuss mailing list