I'm trying to make a condition that matches any amount of spaces in a file name $f
. But what I have seems to be matching everything?
if [[ $f =~ [[:space:]]* ]]; then
echo found a space
fi
This matches i-have-no-spaces.jpg
as well as i have spaces.jpg