Is this normal? I tried it (long story… it all began with poor quoting on something else) with bash, dash and ksh. In all cases I get:
$ echo [:print:][:blank:]
[:print:][:blank:]
$ touch in
$ echo [:print:][:blank:]
in
I thought it had something to do with ‘in’ being a substring of ‘print’, but (say) ‘pr’ doesn’t do it:
$ rm in; touch pr
$ echo [:print:][:blank:]
[:print:][:blank:]
Also, dropping ‘blank’ gets rid of this:
$ touch in; echo [:print:]
[:print:]
I am completely lost. Thanks in advance for your help!
[:print:][:blank:]is regarded as a glob pattern, so any filenames matching it will be printed, just like when you sayecho *(try that in an empty directory).[:print:]is interpreted as “one of the characters {:,p,r,i,n,t}” and similarly for[:blank:]; hence the match within, but notpr.(
prwill match[:print:][:print:], though.)