IBM Support

HMC command output on separate lines

How To


Summary

To put HMC Command output onto multiple lines.

Objective

Banner_AIX_i_Linux

Many HMC commands produce output as a comma separated list.

Sometimes you’d like each expression on 1 line.

Maybe so that you can grep for something.
Or just so that it is easier to read.

Environment

The HMC Command Line

Steps

Use sed s/,/\\n/g

Compare this:

one-line.jpg

with this

hscroot@hmc14:~> lshmc -n | sed s/,/\\n/g | grep ipv4addr
ipv4addr_eth0=10.0.255.1
ipv4addr_eth1=9.137.62.30
ipv4addr_eth2=0.0.0.0
ipv4addr_eth3=0.0.0.0

I think that you will agree, the second format is far more readable.

I use this trick nearly every day.

Additional Information

You can contact me: 

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"HW1A1","label":"IBM Power Systems"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF050","label":"BMC"},{"code":"PF041","label":"HMC"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
26 October 2023

UID

ibm11116303