I noticed that several shell script would be simpler and more powerful if they adopted some pattern matching, but this technique so widely adopted in most scripting languages (like Python, PHP and — of course — Perl) is less used in Bash scripts.
The idea to check if some condition is true before executing some commands is very simple and useful. The Bash syntax, for historical reasons, is probably the ugliest you’ll ever see but after a while it will stop scaring you (and your…