DEV Community

Discussion on: linux : bash script conditions

Collapse
 
moopet profile image
Ben Sinclair

You list [ STRING =~ PATTERN ] in your single-bracket conditions, but then go on to say it's different in double-bracket conditions. What did you mean?

I think the main benefit of using single-brackets is that those conditions will likely work in other shells, even if they're not as powerful.

Collapse
 
zakiarsyad profile image
Zaki Arrozi Arsyad

Nice catch man, thanks.
Updated. That regex should work with double brackets [[ STRING =~ PATTERN ]]