Please observe the following:
[user@machine deploy]$ echo ?
?
[user@machine deploy]$ echo ??
??
[user@machine deploy]$ echo ???
lib
[user@machine deploy]$ echo ????
????
What is up with echo ???? Why is that “lib”?
I am not seeing anything in my env or .bashrc, and it is not consistent between machines (on my dev machine, the string ??? stayed ???, which was useful where I was testing for it).
I can work around this no problems- the “???” as a placeholder value was completely arbitrary. But now I am curious. Anyone have any ideas?
Thanks.
In shell globs,
?stands for one character (exactly – one and only one). So if you have a file (or directory) that has a name with exactly three chars,???will match it.Try
touch a; touch bb ; echo ? ??.If you don’t have a file that matches the pattern, the pattern is printed as is, with not replacement.