How to use command to format attribute output