I have a file, I want to determine if it contains only English ASCII characters.
I thought this is a very common question, but when I googled it, there is no direct answer or related.
According to some other questions, this is what I got so far, but this doesn't work. No matter ASCII or Non-ASCII chars, it will always determine as non-ascii.
if (LC_ALL=C; [[ $TEXT = *[[:ascii:]]* ]]) then echo "Contain Non-ASCII" fi
BTW, This is a shell script.