Sample Header Ad - 728x90

Test for a number in bash

-1 votes
2 answers
574 views
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