[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5

unexpand Command

Purpose

Writes to standard output with tabs restored.

Syntax

unexpand-a -t TabList ] [ File ... ]

Description

The unexpand command puts tabs back into the data from the standard input or the named files and writes the result to standard output. By default, only leading spaces and tabs are reconverted to maximal strings of tabs.

Note: The File parameter must be a text file.

Flags

-a Inserts tabs wherever their presence compresses the resultant file by replacing two or more characters.
-t TabList Specifies the position of the tab stops. The default value of a tab stop is 8 column positions.

The TabList variable must consist of a single positive-decimal integer or multiple positive-decimal integers. The multiple integers must be in ascending order and must be separated by commas or by blank characters with quotation marks around the integers. The single TabList variable sets the tab stops an equal number of column positions apart. The multiple TabList variable sets the tab stop at column positions that correspond to the integers in the TabList variable.

A space-to-tab conversion does not occur for characters at positions beyond the last one specified in a multiple TabList variable.

Note: When the -t flag is specified, the -a flag is ignored and conversion is not limited to processing leading blank characters.

Exit Status

This command returns the following exit values:

0 The command ran successfully.
>0 An error occurred.

Example

To replace space characters with tab characters in the xyz file, enter:

unexpand xyz

Files

/usr/bin/unexpand Contains the unexpand command.

Related Information

The expand command, newform command, tab command, untab command.

Files Overview in AIX 5L Version 5.2 System User's Guide: Operating System and Devices.

Input and Output Redirection Overview in AIX 5L Version 5.2 System User's Guide: Operating System and Devices.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]