EXPAND(1POSIX)
π EXPAND(1POSIX) π
okay bestie, welcome to the POSIX Programmer's Manual page for expand, and honestly? she's a vibe. π¦
πΈ PROLOG
Real talk first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or the interface may not even be implemented on Linux. π
β¨ NAME β¨
expand β convert tabs to spaces π
π SYNOPSIS π
expand [-t tablist] [file...]
π DESCRIPTION π
So the expand utility shall write files β or the standard input β to the standard output, with <tab> characters replaced with one or more <space> characters needed to pad to the next tab stop. No cap, that's the whole job. β¨
Any <backspace> characters shall be copied to the output, and they cause the column position count for tab stop calculations to be decremented. And listen β the column position count shall not be decremented below zero. She does not go negative, periodt. π«Ά
π OPTIONS π
The expand utility shall conform to the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines.
The following option shall be supported:
-ttablist β Specify the tab stops. The application shall ensure that the argument tablist consists of either a single positive decimal integer or a list of tabstops. If a single number is given, tabs shall be set that number of column positions apart instead of the default8. π
If a list of tabstops is given, the application shall ensure that it consists of a list of two or more positive decimal integers, separated by <blank> or <comma> characters, in ascending order. The <tab> characters shall be set at those specific column positions. Each tab stop N shall be an integer value greater than zero, and the list is in strictly ascending order. This is taken to mean that, from the start of a line of output, tabbing to position N shall cause the next character output to be in the (N+1)th column position on that line.
In the event of expand having to process a <tab> at a position beyond the last of those specified in a multiple tab-stop list, the <tab> shall be replaced by a single <space> in the output. just one. that's it. πΈ
π¦ OPERANDS π¦
The following operand shall be supported:
- file β The pathname of a text file to be used as input.
π STDIN π
See the INPUT FILES section. (she's pointing you over there, go look π)
π INPUT FILES π
Input files shall be text files.
β ENVIRONMENT VARIABLES β
The following environment variables shall affect the execution of expand:
LANGβ Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ If set to a non-empty string value, override the values of all the other internationalization variables.LC_CTYPEβ Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files), the processing of<tab>and<space>characters, and for the determination of the width in column positions each character would occupy on an output device.LC_MESSAGESβ Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ Determine the location of message catalogs for the processing ofLC_MESSAGES.
π§ ASYNCHRONOUS EVENTS π§
Default. (she's chill like that π )
πΈ STDOUT πΈ
The standard output shall be equivalent to the input files with <tab> characters converted into the appropriate number of <space> characters. glow up complete β¨
π STDERR π
The standard error shall be used only for diagnostic messages. nothing else, bestie.
π OUTPUT FILES π
None.
π¦ EXTENDED DESCRIPTION π¦
None.
π EXIT STATUS π
The following exit values shall be returned:
0β Successful completion π>0β An error occurred. π
π₯ CONSEQUENCES OF ERRORS π₯
The expand utility shall terminate with an error message and non-zero exit status upon encountering difficulties accessing one of the file operands. like if she can't get to your file, she's out. πͺπ¨
The following sections are informative.
π APPLICATION USAGE π
None.
π EXAMPLES π
None.
π«Ά RATIONALE π«Ά
The expand utility is useful for preprocessing text files (before sorting, looking at specific columns, and so on) that contain <tab> characters.
See the Base Definitions volume of POSIX.1β2017, Section 3.103, Column Position.
The tablist option-argument consists of integers in ascending order. Utility Syntax Guideline 8 mandates that expand shall accept the integers (within the single argument) separated using either <comma> or <blank> characters.
Earlier versions of this standard allowed the following form in the SYNOPSIS:
expand [-tabstop][-tab1,tab2,...,tabn][file ...]
This form is no longer specified by POSIX.1β2008 but may be present in some implementations. so like, ancient lore. she doesn't do that anymore, but your grandma's script might. π΅
π§ FUTURE DIRECTIONS π§
None.
π SEE ALSO π
tabs, unexpand
The Base Definitions volume of POSIX.1β2017, Section 3.103, Column Position, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole page bestie, ily, go convert some tabs πβ¨πΈ
This one's brought to you by IEEE/The Open Group, dated 2017 β mwah, slay, periodt. ππ
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms