I have a huge dictionary file that contains each word in each line, and would like to split the files by the first character of the words.
a.txt --> only contains the words that start with a
I used this awk commands to successfully extract words that start with b.
awk 'tolower($0)~/^b/{print}' titles-sorted.txt > b.txt
Now I wanted to iterate this for all alphabets
for alphabet in {a..z}
do
awk 'tolower($0)~/^alphabet/{print}' titles-sorted.txt > titles-links/^alphabet.txt
done
But the result files contain no contents. What did I do wrong? I don't even know how to debug this. Thanks!