i wrote the following bash script
#!/bin/bash
serverlist=server_list.txt
for server in `cat $serverlist`
do
out="hostnamectl | egrep 'Kernel|Server|hostname';who -b"
ssh -q $server $out
and I get the following output ~
Static hostname: mshost25
Operating System: Red Hat Enterprise Linux Server 7.9 (Maipo)
Kernel: Linux 3.10.0-1160.31.1.el7.x86_64
system boot 2021-06-24 11:42
I would like the output to be in columns
Static hostname Operating System Kernel: sytem boot
mypc1 Linux Server 7.9 Linux 3.10.0-1160.31.1.el7.x86_64 2021-06-24 11:33