Automation, Orchestration, and Scripting

A script reads a value into the variable count and must proceed only if the value consists entirely of digits. Which test performs this check using a regular expression?

Show the answer

Correct answerA. [[ "$count" =~ ^[0-9]+$ ]]

The =~ operator performs extended regular expression matching and is available only inside [[ ]]. The single-bracket form fails because test does not support =~, and == in [[ ]] does glob matching, so the caret and plus sign would be treated as literal characters.