6

The three wildcards in the unix shell are *, ?, and []. Can I change the settings of such wildcards? For example, the symbol or their behaviour?

In an attempt to answer the question myself, I searched for "create new wildcard shell" and "change wildcard shell settings" but could not find anything relevant. Are these settings "hard-coded" into the shell?

PS: I guess I'm referring to bash, which is the default one I use (Xubuntu). Maybe other shells like tcsh, ksh, fish, etc are more customizable?

3

No, you can't. Not without recompiling Bash. But changing something as basic and ubiquitous as the glob characters would break compatibility with a huge majority of Bash scripts, so if you do this, please don't call the resulting binary "bash."

zsh has more flexibility in its globbing, but even then you can't arbitrarily define your own syntax.

The closest thing to what you want (redefinable pattern matching languages) isn't in any shell, but sounds a lot like Perl 6. Be warned: it's not for the faint of heart.

|improve this answer|||||
  • Nothing serious and nothing personal either, that was just an attempt at a pun which I'm removing right now since my English is not good enough to make it understandable and funny. – xhienne Jul 28 '17 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.