looping over AWK commands doesn't work : <p>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. </p>

<p>a.txt --> only contains the words that start with a</p>

<p>I used this awk commands to successfully extract words that start with b.</p>

<pre><code>  awk 'tolower($0)~/^b/{print}' titles-sorted.txt &gt; b.txt
</code></pre>

<p>Now I wanted to iterate this for all alphabets</p>

<pre><code>  for alphabet in {a..z} 
    do
        awk 'tolower($0)~/^alphabet/{print}' titles-sorted.txt &gt; titles-links/^alphabet.txt
    done 
</code></pre>

<p>But the result files contain no contents. What did I do wrong? I don't even know how to debug this. Thanks! </p>
