3 ms·
fnmatch () { case "$2" in $1) return 0 ;; *) return 1 ;; esac ; } So much for needing Bash’s “[[” command... I've bookmarked this article. However, I think t
by Myrmornis 11y ago
fnmatch () { case "$2" in $1) return 0 ;; *) return 1 ;; esac ; }
So much for needing Bash’s “[[” command...
I've bookmarked this article. However, I think the author advocates too strongly for custom functions which "know better" than native functionality. It seems to be written more for the situation of "my personal shell scripts" than a "codebase". I wouldn't, for example, want to work in a codebase where people have redefined `echo` using the shell function he suggests. With a different name, perhaps.