UNEXPAND(1)
π UNEXPAND(1) π
ok so real talk, this is a page from User Contributed Perl Documentation (yes, the Perl Power Tools crew, ily) and it's literally called unexpand. iconic name, does exactly what it says on the tin.
β¨ NAME β¨
unexpand β convert spaces to tabs π¦ that's it. that's the whole thing. she's a reverse-girlie.
πΈ SYNOPSIS πΈ
unexpand [-a] [-tabstop] [-tab1,tab2,...] [file ...]
π DESCRIPTION π
ok bestie, so first things first, there's a plot twist: this bit of the description literally talks about expand, not unexpand. and that's not a typo on my part β the docs got borrowed straight from the BSD expand(1) man page (see AUTHOR down below, it's all receipts). so fr fr, here's what it says:
expand processes the named files or the standard input, writing the standard output with tabs changed into blanks. backspace characters are preserved into the output and decrement the column count for tab calculations. expand is useful for pre-processing character files (before sorting, looking at specific columns, etc.) that contain tabs. π«Ά
if a single tabstop argument is given, tabs are set tabstop spaces apart instead of the default 8. if multiple tabstops are given, then the tabs are set at those specific columns. β
now, unexpand β the actual star of the show, main character energy β puts tabs back into the data from the standard input or the named files, and writes the result on the standard output. π she undoes the thing. she re-tabs. we love a comeback story.
π OPTIONS π
-aβ by default, only leading blanks and tabs get reconverted into maximal strings of tabs. if you pass-a, tabs are inserted whenever they would compress the resultant file by replacing two or more characters. so she's not just tidying the edges anymore, she's going full compression mode. π₯ ykyk.
ok and that's genuinely the only option on this whole page. one single flag. minimalism. she's not doing the most and honestly? respect. π
π AUTHOR π
the Perl implementation was written by Thierry Bezecourt, thbzcrt@worldnet.fr. that's the Perl Power Tools project, March 1999. π
and this documentation comes from the BSD expand(1) man page. (told you. mystery solved. we been knew. π΅οΈ)
π COPYRIGHT and LICENSE π
this program is free and open software. you may use, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same. like, genuinely, do whatever, just don't be a gatekeeper about it. π that's the whole vibe check and it passed with flying colours. β¨
so yeah. that's unexpand. tabs back in, spaces out, one flag, zero drama.
perl v5.42.2 π¦ 2026-02-15 β mwah, that's the version and date, love you, bye bestie ππ
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms