Is this the correct way to test for a number, with double
[[]]
enclosing :digit:
and single quotes surrounding the regex ?
if [[ "$var" =~ '^[[:digit:]]+$' ]]; then
Asked by Vera
(1363 rep)
Jan 29, 2023, 03:30 AM
Last activity: Jan 29, 2023, 09:36 AM
Last activity: Jan 29, 2023, 09:36 AM