Never fear. awk is here. I wrote this tiny script to append spaces to each line so they all had at least length 35.
Here's normalize.awk
#!/usr/bin/gawk -f
{
str = $1
difference = 35 - length($1);
while(difference > 0)
{
str = str " "
difference--
}
print str
}
and here's the finished command:
grep --color=always st$ dict | ./normalize.awk | column
This command found all the words in the dictionary ending in "st" and displays them in columns with the "st" portion highlighted.
No comments:
Post a Comment