In shell how do I have an even length of spaces by the length of words on my menu?I've tried to get the length of the longest character string and then create each column length by the longest string+1... also I'm having problems with this a lot and I'd like to read more on this topic.Would it be awk or grep?menuNAME       menuNAME2    menuNAME3word word2 THISwordisLongestTHISwordisLongest word     wordLONGwordLONG     THISwordisLongest wordExpected output:menuNAME          menuNAME2         menuNAME3word              wordLONG          THISwordisLongestTHISwordisLongest word              wordLONGwordLONG          THISwordisLongest word
Produce aligned columns in a shell script
shell;columns
You can use column:$ column -t < filemenuNAME           menuNAME2          menuNAME3word               word2              THISwordisLongestTHISwordisLongest  word               wordLONGwordLONG           THISwordisLongest  word