I guess I might as well weigh in also :-)

If you are really running Bash (as opposed to ash, dash, ...) then:

shopt -s extglob

is_numeric() # $1 = value to test for numeric
{
        case "$1" in
                +([0-9]))
                        return 0;
                        ;;
        esac

        return 1;
}

-Tom
-- 
Tom Eastep    \ Shorewall - iptables made easy
Shoreline,     \ http://shorewall.net
Washington USA  \ [EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

Reply via email to