DEV Community

loading...

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 Author

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