logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

expand.1p (6207B)


  1. '\" et
  2. .TH EXPAND "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. expand
  12. \(em convert tabs to spaces
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. expand \fB[\fR-t \fItablist\fB] [\fIfile\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR expand
  21. utility shall write files or the standard input to the standard output
  22. with
  23. <tab>
  24. characters replaced with one or more
  25. <space>
  26. characters needed to pad to the next tab stop. Any
  27. <backspace>
  28. characters shall be copied to the output and cause the column position
  29. count for tab stop calculations to be decremented; the column position
  30. count shall not be decremented below zero.
  31. .SH OPTIONS
  32. The
  33. .IR expand
  34. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  35. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  36. .P
  37. The following option shall be supported:
  38. .IP "\fB\-t\ \fItablist\fR" 10
  39. Specify the tab stops. The application shall ensure that the argument
  40. .IR tablist
  41. consists of either a single positive decimal integer or a list of
  42. tabstops. If a single number is given, tabs shall be set that number of
  43. column positions apart instead of the default 8.
  44. .RS 10
  45. .P
  46. If a list of tabstops is given, the application shall ensure that it
  47. consists of a list of two or more positive decimal integers, separated
  48. by
  49. <blank>
  50. or
  51. <comma>
  52. characters, in ascending order. The
  53. <tab>
  54. characters shall be set at those specific column positions. Each tab stop
  55. .IR N
  56. shall be an integer value greater than zero, and the list is in
  57. strictly ascending order. This is taken to mean that, from the start of
  58. a line of output, tabbing to position
  59. .IR N
  60. shall cause the next character output to be in the (\c
  61. .IR N +1)th
  62. column position on that line.
  63. .P
  64. In the event of
  65. .IR expand
  66. having to process a
  67. <tab>
  68. at a position beyond the last of those specified in a multiple tab-stop
  69. list, the
  70. <tab>
  71. shall be replaced by a single
  72. <space>
  73. in the output.
  74. .RE
  75. .SH OPERANDS
  76. The following operand shall be supported:
  77. .IP "\fIfile\fR" 10
  78. The pathname of a text file to be used as input.
  79. .SH STDIN
  80. See the INPUT FILES section.
  81. .SH "INPUT FILES"
  82. Input files shall be text files.
  83. .SH "ENVIRONMENT VARIABLES"
  84. The following environment variables shall affect the execution of
  85. .IR expand :
  86. .IP "\fILANG\fP" 10
  87. Provide a default value for the internationalization variables that are
  88. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  89. .IR "Section 8.2" ", " "Internationalization Variables"
  90. for the precedence of internationalization variables used to determine
  91. the values of locale categories.)
  92. .IP "\fILC_ALL\fP" 10
  93. If set to a non-empty string value, override the values of all the
  94. other internationalization variables.
  95. .IP "\fILC_CTYPE\fP" 10
  96. Determine the locale for the interpretation of sequences of bytes of
  97. text data as characters (for example, single-byte as opposed to
  98. multi-byte characters in arguments and input files), the processing of
  99. <tab>
  100. and
  101. <space>
  102. characters, and for the determination of the width in column positions
  103. each character would occupy on an output device.
  104. .IP "\fILC_MESSAGES\fP" 10
  105. .br
  106. Determine the locale that should be used to affect the format and
  107. contents of diagnostic messages written to standard error.
  108. .IP "\fINLSPATH\fP" 10
  109. Determine the location of message catalogs for the processing of
  110. .IR LC_MESSAGES .
  111. .SH "ASYNCHRONOUS EVENTS"
  112. Default.
  113. .SH STDOUT
  114. The standard output shall be equivalent to the input files with
  115. <tab>
  116. characters converted into the appropriate number of
  117. <space>
  118. characters.
  119. .SH STDERR
  120. The standard error shall be used only for diagnostic messages.
  121. .SH "OUTPUT FILES"
  122. None.
  123. .SH "EXTENDED DESCRIPTION"
  124. None.
  125. .SH "EXIT STATUS"
  126. The following exit values shall be returned:
  127. .IP "\00" 6
  128. Successful completion
  129. .IP >0 6
  130. An error occurred.
  131. .SH "CONSEQUENCES OF ERRORS"
  132. The
  133. .IR expand
  134. utility shall terminate with an error message and non-zero exit status
  135. upon encountering difficulties accessing one of the
  136. .IR file
  137. operands.
  138. .LP
  139. .IR "The following sections are informative."
  140. .SH "APPLICATION USAGE"
  141. None.
  142. .SH EXAMPLES
  143. None.
  144. .SH RATIONALE
  145. The
  146. .IR expand
  147. utility is useful for preprocessing text files (before sorting, looking
  148. at specific columns, and so on) that contain
  149. <tab>
  150. characters.
  151. .P
  152. See the Base Definitions volume of POSIX.1\(hy2017,
  153. .IR "Section 3.103" ", " "Column Position".
  154. .P
  155. The
  156. .IR tablist
  157. option-argument consists of integers in ascending order. Utility Syntax
  158. Guideline 8 mandates that
  159. .IR expand
  160. shall accept the integers (within the single argument) separated using
  161. either
  162. <comma>
  163. or
  164. <blank>
  165. characters.
  166. .P
  167. Earlier versions of this standard allowed the following form in
  168. the SYNOPSIS:
  169. .sp
  170. .RS 4
  171. .nf
  172. expand \fB[\fR-tabstop\fB][\fR-tab1,tab2,...,tabn\fB][\fIfile\fR ...\fB]\fR
  173. .fi
  174. .P
  175. .RE
  176. .P
  177. This form is no longer specified by POSIX.1\(hy2008 but may be present
  178. in some implementations.
  179. .SH "FUTURE DIRECTIONS"
  180. None.
  181. .SH "SEE ALSO"
  182. .IR "\fItabs\fR\^",
  183. .IR "\fIunexpand\fR\^"
  184. .P
  185. The Base Definitions volume of POSIX.1\(hy2017,
  186. .IR "Section 3.103" ", " "Column Position",
  187. .IR "Chapter 8" ", " "Environment Variables",
  188. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  189. .\"
  190. .SH COPYRIGHT
  191. Portions of this text are reprinted and reproduced in electronic form
  192. from IEEE Std 1003.1-2017, Standard for Information Technology
  193. -- Portable Operating System Interface (POSIX), The Open Group Base
  194. Specifications Issue 7, 2018 Edition,
  195. Copyright (C) 2018 by the Institute of
  196. Electrical and Electronics Engineers, Inc and The Open Group.
  197. In the event of any discrepancy between this version and the original IEEE and
  198. The Open Group Standard, the original IEEE and The Open Group Standard
  199. is the referee document. The original Standard can be obtained online at
  200. http://www.opengroup.org/unix/online.html .
  201. .PP
  202. Any typographical or formatting errors that appear
  203. in this page are most likely
  204. to have been introduced during the conversion of the source files to
  205. man page format. To report such errors, see
  206. https://www.kernel.org/doc/man-pages/reporting_bugs.html .