[go: nahoru, domu]

Jump to content

Unexpand: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Syntax
m Standardize software category names.
Line 13: Line 13:
Here the [[echo]] command prints a string of text that includes multiple consecutive spaces, then the output is directed into the '''unexpand''' command. The resulting output is then displayed by the [[octal]] dump command [[od]]. At the second prompt, the same echo output is sent directly through the '''od''' command. As can be seen by comparing the two, the '''unexpand''' program converts sequences of eight spaces into single tabs (printed as '\t').
Here the [[echo]] command prints a string of text that includes multiple consecutive spaces, then the output is directed into the '''unexpand''' command. The resulting output is then displayed by the [[octal]] dump command [[od]]. At the second prompt, the same echo output is sent directly through the '''od''' command. As can be seen by comparing the two, the '''unexpand''' program converts sequences of eight spaces into single tabs (printed as '\t').


[[Category:Unix programs]]
[[Category:Unix software]]

Revision as of 18:13, 11 August 2005

unexpand is a command in the UNIX Operating System. It is used to convert groups of space characters into tabs.

For example:

$ echo "                 asdf sdf" | unexpand | od -c
0000000  \t  \t       a   s   d   f       s   d   f  \n
0000014
$ echo "                 asdf sdf" | od -c
0000000
0000020       a   s   d   f       s   d   f  \n
0000032

Here the echo command prints a string of text that includes multiple consecutive spaces, then the output is directed into the unexpand command. The resulting output is then displayed by the octal dump command od. At the second prompt, the same echo output is sent directly through the od command. As can be seen by comparing the two, the unexpand program converts sequences of eight spaces into single tabs (printed as '\t').