1expand(1)                        User Commands                       expand(1)
2
3
4

NAME

6       expand,  unexpand - expand TAB characters to SPACE characters, and vice
7       versa
8

SYNOPSIS

10       expand [-t tablist] [file]...
11
12
13       expand [-tabstop] [-tab1, tab2,. . ., tabn] [file]...
14
15
16       unexpand [-a] [-t tablist] [file]...
17
18

DESCRIPTION

20       The expand utility copies files (or the standard input) to the standard
21       output,  with  TAB  characters  expanded to SPACE characters. BACKSPACE
22       characters are preserved into the output and decrement the column count
23       for  TAB  calculations.  expand  is useful for pre-processing character
24       files (before sorting, looking at specific columns, and so forth)  that
25       contain TAB characters.
26
27
28       unexpand  copies  files (or the standard input) to the standard output,
29       putting TAB characters back into the data.  By  default,  only  leading
30       SPACE and TAB characters are converted to strings of tabs, but this can
31       be overridden by the -a option (see the OPTIONS section below).
32

OPTIONS

34       The following options are supported for expand:
35
36       -t tablist                Specifies the tab stops. The argument tablist
37                                 must  consist  of  a  single positive decimal
38                                 integer or multiple  positive  decimal  inte‐
39                                 gers,  separated  by blank characters or com‐
40                                 mas, in ascending order. If a  single  number
41                                 is  given,  tabs  will  be set tablist column
42                                 positions apart instead of the default 8.  If
43                                 multiple  numbers are given, the tabs will be
44                                 set at those specific column positions.
45
46                                 Each tab-stop position N must be  an  integer
47                                 value greater than zero, and the list must be
48                                 in strictly ascending order. This is taken to
49                                 mean  that,  from the start of a line of out‐
50                                 put, tabbing to position N  causes  the  next
51                                 character  output to be in the (N+1)th column
52                                 position on that line.
53
54                                 In the event of expand having  to  process  a
55                                 tab  character  at a position beyond the last
56                                 of those specified  in  a  multiple  tab-stop
57                                 list, the tab character is replaced by a sin‐
58                                 gle space character in the output.
59
60
61       -tabstop                  Specifies as  a  single  argument,  sets  TAB
62                                 characters  tabstop  SPACE  characters  apart
63                                 instead of the default 8.
64
65
66       -tab1,tab2,...,tabn       Sets TAB characters at the columns  specified
67                                 by -tab1,tab2,...,tabn
68
69
70
71       The following options are supported for unexpand:
72
73       -a             Inserts  TAB  characters  when replacing a run of two or
74                      more SPACE characters would  produce  a  smaller  output
75                      file.
76
77
78       -t tablist     Specifies  the  tab  stops.  The option-argument tablist
79                      must be a single argument consisting of a  single  posi‐
80                      tive  decimal integer or multiple positive decimal inte‐
81                      gers,  separated  by  blank  characters  or  commas,  in
82                      ascending order.  If a single number is given, tabs will
83                      be set tablist column positions  apart  instead  of  the
84                      default  8. If multiple numbers are given, the tabs will
85                      be set at those specific column positions. Each tab-stop
86                      position  N  must be an integer value greater than zero,
87                      and the list must be in strictly ascending  order.  This
88                      is  taken to mean that, from the start of a line of out‐
89                      put, tabbing to position N will cause the next character
90                      output  to  be  in  the  (N+1)th column position on that
91                      line. When the -t option is not specified,  the  default
92                      is  the  equivalent  of  specifying -t 8 (except for the
93                      interaction with -a, described below).
94
95                      No space-to-tab character conversions occur for  charac‐
96                      ters  at positions beyond the last of those specified in
97                      a multiple tab-stop list.
98
99                      When -t is specified, the presence or absence of the  -a
100                      option is ignored; conversion will not be limited to the
101                      processing of leading blank characters.
102
103

OPERANDS

105       The following ooperand is supported for expand and unexpand:
106
107       file     The path name of a text file to be used as input.
108
109

ENVIRONMENT VARIABLES

111       See environ(5) for descriptions of the following environment  variables
112       that  affect  the  execution  of  expand  and  unexpand:  LANG, LC_ALL,
113       LC_CTYPE, LC_MESSAGES, and NLSPATH.
114

EXIT STATUS

116       The following exit values are returned:
117
118       0      Successful completion
119
120
121       >0     An error occurred.
122
123

ATTRIBUTES

125       See attributes(5) for descriptions of the following attributes:
126
127
128
129
130       ┌─────────────────────────────┬─────────────────────────────┐
131       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
132       ├─────────────────────────────┼─────────────────────────────┤
133       │Availability                 │SUNWesu                      │
134       ├─────────────────────────────┼─────────────────────────────┤
135       │CSI                          │enabled                      │
136       ├─────────────────────────────┼─────────────────────────────┤
137       │Interface Stability          │Standard                     │
138       └─────────────────────────────┴─────────────────────────────┘
139

SEE ALSO

141       tabs(1), attributes(5), environ(5), standards(5)
142
143
144
145SunOS 5.11                        1 Feb 1995                         expand(1)
Impressum