7 ms·
page 112 > if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then > ... is an option that starts with one or multiple - characters ... "one or multiple" is + not *. The regex
by danadam 1y ago
page 112
> if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
> ... is an option that starts with one or multiple - characters ...
"one or multiple" is + not *. The regex above will also match "h" and "help" without - character(s).