help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking numeric arguments


From: irenezerafa
Subject: Checking numeric arguments
Date: Wed, 17 Nov 2021 03:03:58 +0000

I want to check if arguments are numeric. Is the following a good way, using 
case-like patterns
and using = inside double bracketing [[ ]].

if [[ "$2" = +([[:digit:]]) ]] && [[ "$3" = +([[:digit:]]) ]]; then

reply via email to

[Prev in Thread] Current Thread [Next in Thread]