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

unexpand.1p (7238B)


  1. '\" et
  2. .TH UNEXPAND "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. unexpand
  12. \(em convert spaces to tabs
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. unexpand \fB[\fR-a|-t \fItablist\fB] [\fIfile\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR unexpand
  21. utility shall copy files or standard input to standard output,
  22. converting
  23. <blank>
  24. characters at the beginning of each line into the maximum number of
  25. <tab>
  26. characters followed by the minimum number of
  27. <space>
  28. characters needed to fill the same column positions originally filled
  29. by the translated
  30. <blank>
  31. characters. By default, tabstops shall be set at every eighth column
  32. position. Each
  33. <backspace>
  34. shall be copied to the output, and shall cause the column position
  35. count for tab calculations to be decremented; the count shall never be
  36. decremented to a value less than one.
  37. .SH OPTIONS
  38. The
  39. .IR unexpand
  40. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  41. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  42. .P
  43. The following options shall be supported:
  44. .IP "\fB\-a\fP" 10
  45. In addition to translating
  46. <blank>
  47. characters at the beginning of each line, translate all sequences of
  48. two or more
  49. <blank>
  50. characters immediately preceding a tab stop to the maximum number of
  51. <tab>
  52. characters followed by the minimum number of
  53. <space>
  54. characters needed to fill the same column positions originally filled
  55. by the translated
  56. <blank>
  57. characters.
  58. .IP "\fB\-t\ \fItablist\fR" 10
  59. Specify the tab stops. The application shall ensure that the
  60. .IR tablist
  61. option-argument is a single argument consisting of a single positive
  62. decimal integer or multiple positive decimal integers, separated by
  63. <blank>
  64. or
  65. <comma>
  66. characters, in ascending order. If a single number is given, tabs shall
  67. be set
  68. .IR tablist
  69. column positions apart instead of the default 8. If multiple numbers
  70. are given, the tabs shall be set at those specific column positions.
  71. .RS 10
  72. .P
  73. The application shall ensure that each tab-stop position
  74. .IR N
  75. is an integer value greater than zero, and the list shall be in
  76. strictly ascending order. This is taken to mean that, from the start of
  77. a line of output, tabbing to position
  78. .IR N
  79. shall cause the next character output to be in the (\c
  80. .IR N +1)th
  81. column position on that line. When the
  82. .BR \-t
  83. option is not specified, the default shall be the equivalent of
  84. specifying
  85. .BR "\-t\ 8"
  86. (except for the interaction with
  87. .BR \-a ,
  88. described below).
  89. .P
  90. No
  91. <space>-to-\c
  92. <tab>
  93. conversions shall occur for characters at positions beyond the last of
  94. those specified in a multiple tab-stop list.
  95. .P
  96. When
  97. .BR \-t
  98. is specified, the presence or absence of the
  99. .BR \-a
  100. option shall be ignored; conversion shall not be limited to the
  101. processing of leading
  102. <blank>
  103. characters.
  104. .RE
  105. .SH OPERANDS
  106. The following operand shall be supported:
  107. .IP "\fIfile\fR" 10
  108. A pathname of a text file to be used as input.
  109. .SH STDIN
  110. See the INPUT FILES section.
  111. .SH "INPUT FILES"
  112. The input files shall be text files.
  113. .SH "ENVIRONMENT VARIABLES"
  114. The following environment variables shall affect the execution of
  115. .IR unexpand :
  116. .IP "\fILANG\fP" 10
  117. Provide a default value for the internationalization variables that are
  118. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  119. .IR "Section 8.2" ", " "Internationalization Variables"
  120. for the precedence of internationalization variables used to determine
  121. the values of locale categories.)
  122. .IP "\fILC_ALL\fP" 10
  123. If set to a non-empty string value, override the values of all the
  124. other internationalization variables.
  125. .IP "\fILC_CTYPE\fP" 10
  126. Determine the locale for the interpretation of sequences of bytes of
  127. text data as characters (for example, single-byte as opposed to
  128. multi-byte characters in arguments and input files), the processing of
  129. <tab>
  130. and
  131. <space>
  132. characters, and for the determination of the width in column positions
  133. each character would occupy on an output device.
  134. .IP "\fILC_MESSAGES\fP" 10
  135. .br
  136. Determine the locale that should be used to affect the format and
  137. contents of diagnostic messages written to standard error.
  138. .IP "\fINLSPATH\fP" 10
  139. Determine the location of message catalogs for the processing of
  140. .IR LC_MESSAGES .
  141. .SH "ASYNCHRONOUS EVENTS"
  142. Default.
  143. .SH STDOUT
  144. The standard output shall be equivalent to the input files with
  145. the specified
  146. <space>-to-\c
  147. <tab>
  148. conversions.
  149. .SH STDERR
  150. The standard error shall be used only for diagnostic messages.
  151. .SH "OUTPUT FILES"
  152. None.
  153. .SH "EXTENDED DESCRIPTION"
  154. None.
  155. .SH "EXIT STATUS"
  156. The following exit values shall be returned:
  157. .IP "\00" 6
  158. Successful completion.
  159. .IP >0 6
  160. An error occurred.
  161. .SH "CONSEQUENCES OF ERRORS"
  162. Default.
  163. .LP
  164. .IR "The following sections are informative."
  165. .SH "APPLICATION USAGE"
  166. One non-intuitive aspect of
  167. .IR unexpand
  168. is its restriction to leading
  169. <space>
  170. characters when neither
  171. .BR \-a
  172. nor
  173. .BR \-t
  174. is specified. Users who always want to convert all
  175. <space>
  176. characters in a file can easily alias
  177. .IR unexpand
  178. to use the
  179. .BR \-a
  180. or
  181. .BR "\-t\ 8"
  182. option.
  183. .SH EXAMPLES
  184. None.
  185. .SH RATIONALE
  186. On several occasions, consideration was given to adding a
  187. .BR \-t
  188. option to the
  189. .IR unexpand
  190. utility to complement the
  191. .BR \-t
  192. in
  193. .IR expand
  194. (see
  195. .IR "\fIexpand\fR\^").
  196. The historical intent of
  197. .IR unexpand
  198. was to translate multiple
  199. <blank>
  200. characters into tab stops, where tab stops were a multiple of eight
  201. column positions on most UNIX systems. An early proposal omitted
  202. .BR \-t
  203. because it seemed outside the scope of the User Portability Utilities
  204. option; it was not described in any of the base documents for IEEE\ Std 1003.2\(hy1992.
  205. However, hard-coding tab stops every eight columns was not suitable
  206. for the international community and broke historical precedents for
  207. some vendors in the FORTRAN community, so
  208. .BR \-t
  209. was restored in conjunction with the list of valid extension categories
  210. considered by the standard developers. Thus,
  211. .IR unexpand
  212. is now the logical converse of
  213. .IR expand .
  214. .SH "FUTURE DIRECTIONS"
  215. None.
  216. .SH "SEE ALSO"
  217. .IR "\fIexpand\fR\^",
  218. .IR "\fItabs\fR\^"
  219. .P
  220. The Base Definitions volume of POSIX.1\(hy2017,
  221. .IR "Chapter 8" ", " "Environment Variables",
  222. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  223. .\"
  224. .SH COPYRIGHT
  225. Portions of this text are reprinted and reproduced in electronic form
  226. from IEEE Std 1003.1-2017, Standard for Information Technology
  227. -- Portable Operating System Interface (POSIX), The Open Group Base
  228. Specifications Issue 7, 2018 Edition,
  229. Copyright (C) 2018 by the Institute of
  230. Electrical and Electronics Engineers, Inc and The Open Group.
  231. In the event of any discrepancy between this version and the original IEEE and
  232. The Open Group Standard, the original IEEE and The Open Group Standard
  233. is the referee document. The original Standard can be obtained online at
  234. http://www.opengroup.org/unix/online.html .
  235. .PP
  236. Any typographical or formatting errors that appear
  237. in this page are most likely
  238. to have been introduced during the conversion of the source files to
  239. man page format. To report such errors, see
  240. https://www.kernel.org/doc/man-pages/reporting_bugs.html .