Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
On 06-03-17 15:16, Reuti wrote:
> if ! expr "$x" : '[[:digit:]]*$' >/dev/null; then echo no; fi
>
> if [ -n "${x//[0-9]/}" ]; then echo no; fi
True, but regular expressions are usually considered expensive.
(Must admit I never benchmarked.)
And I know 1 regex won't considerably slow down my script, but it's
become a habit to always try and program as light as possible.
--
-- Rob la Lau
--
-- Sysadmin en webdeveloper in ruste
--
-- web : https://ohreally.nl/
-- eml : rob@ohreally.nl
--