I have the following script in works:#!/bin/bashIFS=$(echo -en \n\b)echo -e ----------------------------------------------------------------------------------------------echo -e | Job  Name                      | Enabled | Client Names    | Retention | Schedule    | Type |echo -e ----------------------------------------------------------------------------------------------vcenter_name=$(cat /usr/local/vdr/etc/vcenterinfo.cfg | grep vcenter-hostname | cut -d '=' -f 2)# To extract job names:job_name=$(mccli group show --recursive=true | grep -i /$vcenter_name/VirtualMachines | awk -F/. '{print $(NF-2)}')for i in $job_namedoenabled=$(mccli group show --name=/$vcenter_name/VirtualMachines/$i | grep Enabled | awk '{print $NF}')client_name=$(mccli group show-members --name=/vcenter-prod.happycow.local/VirtualMachines/$i | awk '{print $3}' | tail -n +4 | awk -F/ '{print $NF}')printf | %-27s | %7s | %7s | %10s | %7s | %12s |\n $i $enabled $client_namedoneThe script runs great but need some help in formatting.The output I get now is:----------------------------------------------------------------------------------------------| Job  Name                      | Enabled | Client Names    | Retention | Schedule    | Type |----------------------------------------------------------------------------------------------| Backup With Space              |    true |   Space |            |         |              || Disk-Level                     |    true |         |            |         |              || Linux-VM                       |    true |         |            |         |              || Partial                        |    true |         |            |         |              || Prod-Backup                    |   false | VM-BVM-D |            |         |              || Same-Host                      |    true |         |            |         |              || Temp                           |    true | esxi02ESXi-6.5ESXi6GA |            |         |              |I would like to see it as:----------------------------------------------------------------------------------------------| Job  Name                      | Enabled | Client Names    | Retention | Schedule    | Type |----------------------------------------------------------------------------------------------| Backup With Space              |    true |   Space |            |         |              || Disk-Level                     |    true |         |            |         |              || Linux-VM                       |    true |         |            |         |              || Partial                        |    true |         |            |         |              || Prod-Backup                    |   false | VM-B    |            |         |              ||                                            VM-D    |            |         |              || Same-Host                      |    true |         |            |         |              || Temp                           |    true | esxi02|                                            ESXi6.5|                                            ESXi6GA |            |         |              |Ignore the | alignment. I can take care of that one.So basically, I would like to have the multi value / multi line output of job_name variable under a single column.
Printing multi-line variable output into a single column
bash;shell