There may be times when you have finished up writing code, but need to change tabs to spaces for a file to display consistently among different computers. The
unexpand commands help you convert from spaces to tabs and tabs to spaces.
In a pipeline,
expand converts tabs to spaces. Using specific options, you can specify a number of parameters.
$ expand -t 4 sample.xml # Convert every tab into four spaces <?xml version="1.0" encoding="UTF-8"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Please do not forget me this weekend!</body> </note>
unexpand filter does the opposite - it converts spaces to tabs.
In this example, assume that each "tab" instance is four spaces.
$ unexpand -t 2 sample.xml # Convert every two spaces to a tab <?xml version="1.0" encoding="UTF-8"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Please do not forget me this weekend!</body> </note>
This book approaches system administration in a practical way and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, and much more.$ Check price
This foam seat cushion relieves lowerback pain, numbness and pressure sores by promoting healthy weight distribution, posture and spine alignment. Furthermore, it reduces pressure on the tailbone and hip bones while sitting. Perfect for sitting on the computer desk for long periods of time.$ Check price