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?

1

1 Answer 1

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.

1
  • 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, 2017 at 8:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .