I’m not entirely certain why I developed this, I thought it would be easyish (it was not) and a fun challenge (painful more like).
Anyhow, this script prints bits of interface ethernet and formats it in to a fairly neat table.
Is it good code? probably not, but it seems to do what I say it does. It only seems to have a hard time formatting where the original interface name is much longer or shorter then the rest.
The (good ol') trick we used in DOS batches was to APPEND to the variable value a number of characters (spaces or underscores) and then TRIM it to a given length (in practice transforming the table records from delimited to fixed length).
BUT in Ros we have this nice feature discovered by Amm0:
in practice you place the beginning of each string (variable value) at a given column by "going back" to column 0 and moving forward for the desired number of characters/tabs.
If there are not too many entries (not thousands or more), you can use print as-value to fetch all data as array, to reduce the number of [get] commands to be executed, combined with the \r trick from @Amm0:
If you are lazy and don't care about efficiency then proplist=default-name,name,orig-mac-address,mac-address,mtu,l2mtu can also be replaced with detail. But it will consume more CPU and RAM.