I\'m new to awk and sed, and I\'m looking for a way to truncate a line at 80 characters, but I\'m printing several strings in that line using printf. The last two strings are th
I'm looking for a way to truncate a line at 80 characters ...
You could pipe the output to cut:
cut
printf ... | cut -c 1-80
If you wanted to ensure that each line isn't more than 80 characters (or wrap lines to fit in specified width), you could use fold:
fold
printf ... | fold -w 80