Skip to main content
13 votes
Accepted

POSIX sh alternative to using [[ ... ]] in Bash

Most people use case statements for option processing because it's simple and easy and it works. There are countless examples using either built-in getopts or /usr/bin/getopt or custom/hand-crafted. ...
cas's user avatar
  • 84.9k
7 votes

POSIX sh alternative to using [[ ... ]] in Bash

expr and awk are two POSIX utilities that can do regexp matching. expr using basic regexp¹ and awk a variant of extended regexp². expr suffers from a number of design flaws and is usually considered ...
Stéphane Chazelas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible