Check if a file exists with a wildcard in a shell script [duplicate]

I’m trying to check if a file exists, but with a wildcard. Here is my example:

if [ -f "xorg-x11-fonts*" ]; then
    printf "BLAH"
fi

I have also tried it without the double quotes.

21 Answers
21

Leave a Comment