new to coding in general so I hope you'll bear with me. I am trying to get multiple commands run in succession to output data on the same line using a one-liner so I can dump into a spreadsheet and format. Not sure how to go about it or whether its possible as a one-liner. Thank you in advance!
Command:
for i in `cat server_list` ; do echo -n "$i " ; ssh -q $i -o StrictHostKeyChecking=no "sudo dmidecode |grep 'Version: P' | column ; cat /etc/passwd |grep -o root | column"; done
Current output:
<hostname> Version: P00
root root root root
<hostname> Version: P00
root root root root
Desired output:
<hostname> Version: P00 root root root root
<hostname> Version: P00 root root root root
question from:
https://stackoverflow.com/questions/65888372/bash-output-from-multiple-commands-on-same-line 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…