by version_five · 4y ago · 0 comments
Why? The only GNUish bit is the grep -P option, which is unnecessary (-E will do as well).
bash is actually pretty powerful if you don't mind its baroque syntax. Writing it in POSIX would be a bit more challenging. You could use a case statement for the pattern matching, but I'm not sure about the substitution.