I have a script that collects values from a cluster. The values, in some cases, have multiple lines. I have a printf format that specifies how the data should be positioned however, it doesn't take into account multiple lines and therefore the spacing is skewed.
The data should look like this:
Service Group AutoStart List System List
foo sys1 sys1
sys2 sys2
Instead it looks like this
Service Group AutoStart List System List
foo sys1
sys2 sys1
sys2
The AutoStart List and System List should be identical, however regardless of that fact I've not figured out how to force the values into the correct columns.
sgheader="\n\033[4m\033[1m%-30s %-30s %-15s\033[0m\033[0m"
sgformat="\n%-30s %-30s %-15s"
printf "${sgheader}" "Service Group" "Autostart List" "System List"
printf "${sgformat}" "${svcgroup}" "${autostrtlist}" "${hosts}"