Commit 1ec907ee authored by xingqiao's avatar xingqiao
Browse files

updating letters.sh

parent 7476b298
cat /usr/share/dict/words | grep ^a > a.txt;
a=$(cat a.txt | wc -l);
cat /usr/share/dict/words | grep ^b > b.txt;
b=$(cat b.txt | wc -l);
cat /usr/share/dict/words | grep ^c > c.txt;
c=$(cat c.txt | wc -l);
cat /usr/share/dict/words | grep ^d > d.txt;
d=$(cat d.txt | wc -l);
cat /usr/share/dict/words | grep ^e > e.txt;
e=$(cat e.txt | wc -l);
cat /usr/share/dict/words | grep ^f > f.txt;
f=$(cat f.txt | wc -l);
cat /usr/share/dict/words | grep ^g > g.txt;
g=$(cat g.txt | wc -l);
cat /usr/share/dict/words | grep ^h > h.txt;
h=$(cat h.txt | wc -l);
cat /usr/share/dict/words | grep ^i > i.txt;
i=$(cat i.txt | wc -l);
cat /usr/share/dict/words | grep ^j > j.txt;
j=$(cat j.txt | wc -l);
cat /usr/share/dict/words | grep ^k > k.txt;
k=$(cat k.txt | wc -l);
cat /usr/share/dict/words | grep ^l > l.txt;
l=$(cat l.txt | wc -l);
cat /usr/share/dict/words | grep ^m > m.txt;
m=$(cat m.txt | wc -l);
cat /usr/share/dict/words | grep ^n > n.txt;
n=$(cat n.txt | wc -l);
cat /usr/share/dict/words | grep ^o > o.txt;
o=$(cat o.txt | wc -l);
cat /usr/share/dict/words | grep ^p > p.txt;
p=$(cat p.txt | wc -l);
cat /usr/share/dict/words | grep ^q > q.txt;
q=$(cat q.txt | wc -l);
cat /usr/share/dict/words | grep ^r > r.txt;
r=$(cat r.txt | wc -l);
cat /usr/share/dict/words | grep ^s > s.txt;
s=$(cat s.txt | wc -l);
cat /usr/share/dict/words | grep ^t > t.txt;
t=$(cat t.txt | wc -l);
cat /usr/share/dict/words | grep ^u > u.txt;
u=$(cat u.txt | wc -l);
cat /usr/share/dict/words | grep ^v > v.txt;
v=$(cat v.txt | wc -l);
cat /usr/share/dict/words | grep ^w > w.txt;
w=$(cat w.txt | wc -l);
cat /usr/share/dict/words | grep ^x > x.txt;
x=$(cat x.txt | wc -l);
cat /usr/share/dict/words | grep ^y > y.txt;
y=$(cat y.txt | wc -l);
cat /usr/share/dict/words | grep ^z > z.txt;
z=$(cat z.txt | wc -l);
max=0;
if [ $a -gt $max ] ; then
max=$a;
max2="a";
fi
if [ $b -gt $max ] ; then
max=$b;
max2="b";
fi
if [ $c -gt $max ] ; then
max=$c;
max2="c";
fi
if [ $d -gt $max ] ; then
max=$d;
max2="d";
fi
if [ $e -gt $max ] ; then
max=$e;
max2="e";
fi
if [ $f -gt $max ] ; then
max=$f;
max2="f";
fi
if [ $g -gt $max ] ; then
max=$g;
max2="g";
fi
if [ $h -gt $max ] ; then
max=$h;
max2="h";
fi
if [ $i -gt $max ] ; then
max=$i;
max2="i";
fi
if [ $j -gt $max ] ; then
max=$j;
max2="j";
fi
if [ $k -gt $max ] ; then
max=$k;
max2="k";
fi
if [ $l -gt $max ] ; then
max=$l;
max2="l";
fi
if [ $m -gt $max ] ; then
max=$m;
max2="m";
fi
if [ $n -gt $max ] ; then
max=$n;
max2="n";
fi
if [ $o -gt $max ] ; then
max=$o;
max2="o";
fi
if [ $p -gt $max ] ; then
max=$p;
max2="p";
fi
if [ $q -gt $max ] ; then
max=$q;
max2="q";
fi
if [ $r -gt $max ] ; then
max=$r;
max2="r";
fi
if [ $s -gt $max ] ; then
max=$s;
max2="s";
fi
if [ $t -gt $max ] ; then
max=$t;
max2="t";
fi
if [ $u -gt $max ] ; then
max=$u;
max2="u";
fi
if [ $v -gt $max ] ; then
max=$v;
max2="v";
fi
if [ $w -gt $max ] ; then
max=$w;
max2="w";
fi
if [ $x -gt $max ] ; then
max=$x;
max2="x";
fi
if [ $y -gt $max ] ; then
max=$y;
max2="y";
fi
if [ $z -gt $max ] ; then
max=$z;
max2="z";
fi
echo "The letter '$max2' begins with the largest number of words: $max"
head -n 20 $max2.txt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment