I have such issue. In one script I have a formatted printf string. Some columns should be marked in different colors, but if try to mark the with colors it destroy whole formatting.
This one is don't work
printf "%5s|%-6.5s|%-70.69s|%-9.8s|%7.6s|%7.6s|%-15.30s\n" \ "Nr. " " One " "Two" "Three" "Four" ""$(tput setaf 1)"Five"$(tput sgr0)"" " Six"
Without colors works:
printf "%5s|%-6.5s|%-70.69s|%-9.8s|%7.6s|%7.6s|%-15.30s\n" \ "Nr. " " One " "Two" "Three" "Four" "Five" " Six"
Has anybody a solution?
Thanks in advance!