Echo Tab Is Not Working

Echo Tab Is Not Working

I'm using TAB for display a block of code with commnad:

echo -e "192.168.1.103 \t TUNG \t 30:65:ec:1f:77:b7"
echo -e "192.168.1.107 \t LCT3VCLJN2K3MCZ \t 00:1f:c6:53:a5:36"

but it display not correctly in terminal:

But I want it to be display bellow:

I'm using Ubuntu 14.04, please help me !

Thanks in advance !

2

1 Answer

Use the column command:

$ { echo 192.168.1.103 TUNG 30:65:ec:1f:77:b7; echo 192.168.1.107 LCT3VCLJN2K3MCZ 00:1f:c6:53:a5:36;} | column -t
192.168.1.103  TUNG             30:65:ec:1f:77:b7
192.168.1.107  LCT3VCLJN2K3MCZ  00:1f:c6:53:a5:36
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.