To check if the first character is a alphabet or number

Hi,

I need to find whether the first character in a line is a alphabet or a number. If its a number i should sort it numerically. If its a alphabet i should sort it based on the ASCII value.And if it is something other than alphabet or number then sort it based on ASCII value.
The code i used was
char1=`head -3 file1.txt | tail -1 | awk '{print$1}' | cut -c1`
if [ $char1 = [a-zA-Z] ]; then
sort file1.txt > file2.txt
elif [ $char1 -le 9 ]; then
sort -n file1.txt > file2.txt
else
sort file1.txt > file2.txt
fi
The if part where i check for the alphabet is not getting executed. The if part is skipped and it checks for the elif condition.And here in the elif condition it says integer expression expected.

Is something wrong in the code?

I use bash.

Modify the if condition from

 if [ $char1 = [a-zA-Z] ]; then

to

if [ echo $char1 | grep [a-zA-Z] ]; then

This should work. Please check.

use case

case $a in 
[0-9]* ) 
 echo "number" ;;
[a-zA-Z]* ) 
 echo "alphabet"
* ) echo "invalide" ;;
esac