Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 837

Comment by Kamil Maciorowski on sh syntax to handle zero files matching a wildcard, as well as more?

$
0
0
* is allowed in filenames, in particular *.txt is a valid name, so the whole idea is flawed. Additionally in your test there is no expansion at all. Normally unquoted $textfiles or unquoted asterisks in *'*'* trigger globbing, but inside [[ ]] the rules are different. Your [[ $textfiles == *'*'* ]] always returns success!

Viewing all articles
Browse latest Browse all 837

Trending Articles