Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > E

expand(1)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

expand, unexpand — expand tabs to spaces, and vice versa

SYNOPSIS

expand [-t tablist] [file ...]

unexpand [-a] [-t tablist] [file ...]

Obsolescent:

expand [- tabstop] [- tab1,tab2, ..., tabn] [file ...]

DESCRIPTION

expand processes the named files or the standard input and writes to the standard output with tabs changed into spaces. Backspace characters are preserved in the output, and the column count is decreased by one column for tab calculations. For proper tab calculation, if a multi-column character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width. If a tab character is found after the last tab position, it is replaced by a single space. expand is useful for preprocessing character files that contain tabs (before sorting, looking at specific columns, etc).

expand recognizes the following command-line options and arguments:

[-t tablist]

tablist specifies where to set the tab positions instead of the default 8. tablist can take two forms. If it is a single number, tabs are set tablist spaces apart. tablist can also be a blank- or comma-separated list of increasing positions where tabs are to be set.

[-tabstop]

This option is obsolescent and is equivalent to using -t tabstop.

[-tab1,tab2,...,tabn]

This option is obsolescent and is equivalent to using -t tab1,tab2, ... ,tabn.

unexpand processes the named files or the standard input and writes to the standard output with spaces changed into tabs where possible. By default, only leading spaces and tabs are converted to maximal strings of tabs. The default tab position is every 8 characters. Backspace characters are preserved into the output, and the column count is decreased by one column for tab calculations. For proper tab calculation, if a multi-column character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width.

unexpand recognizes the following command-line options and arguments:

-a

Tabs are inserted whenever they would compress the resultant file by replacing two or more spaces before a tab position.

-t tablist

tablist specifies the tab positions. tablist can take two forms. If it is a single number, tabs are set every tablist spaces apart. If tablist is a blank- or comma-separated list of increasing positions, tabs are set at those locations. The -t option implies the -a option. If the -t option is not specified, the default is equivalent to specifying -t 8 except that -a is not implied for this case.

EXTERNAL INFLUENCES

Environment Variables

LC_CTYPE determines the interpretation of text as single and/or multi-byte characters.

LC_MESSAGES determines the language in which messages are displayed.

If LC_CTYPE or LC_MESSAGES is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.

If any internationalization variable contains an invalid setting, expand and unexpand behave as if all internationalization variables are set to "C". See environ(5).

If LC_ALL is set to a non-empty string value, it overrides the values of all the other internationalization variables.

International Code Set Support

Single- and multi-byte character code sets are supported with the exception that unexpand do not recognize multi-byte alternative space characters.

STANDARDS CONFORMANCE

expand: XPG4, POSIX.2

unexpand: XPG4, POSIX.2

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.