![]() |
![]()
| ![]() |
![]()
NAMEdecorate - convert fields of various formats SYNOPSISdecorate [OPTION]... [INPUT]
DESCRIPTIONConverts (and optionally sorts) fields of various formats With --decorate: adds the converted fields to the start of each line and prints and prints it to STDOUT; does not sort. With --undecorate: removes the first N fields from the input; Use as post-processing step after sort(1). Without --decorate and --undecorate: automatically decorates the input, runs sort(1) and undecorates the result; This is the easiest method to use. The decorate program allows sorting input according to various ordering, e.g. IP addresses, roman numerals, etc. It works in tandem with sort(1) to perform the actual sorting. The idea was suggested by Pádraig Brady in https://lists.gnu.org/r/bug-coreutils/2015-06/msg00076.html: 1. Decorate: convert the input to a sortable-format as additional
fields
OPTIONSGeneral Options:
The following options are passed to sort as-is (Most of them assume GNU sort): -c, --check --compress-program --random-source -s, --stable --batch-size -S, --buffer-size -T, --temporary-directory -u, --unique --parallel Available conversions methods (use with -k):
EXAMPLESExample of preparing to sort by roman numerals: $ printf "%s\n" C V III IX XI | decorate -k1,1:roman --decorate 0000100 C 0000005 V 0000003 III 0000009 IX 0000011 XI The output can now be sent to sort(1), followed by removing (=undecorate) the first field. $ printf "%s\n" C V III IX XI \ decorate(1) can automatically combine the decorate-sort-undecorate steps (when run without --decorate or --undecorate): $ printf "%s\n" C V III IX XI | decorate -k1,1:roman III V IX XI C ADDITIONAL INFORMATIONSee GNU Datamash Website (https://www.gnu.org/software/datamash) AUTHORWritten by Assaf Gordon, Timothy Rice, Shawn Wagner and Erik Auerswald. COPYRIGHTCopyright © 2025 Assaf Gordon and Timothy Rice License
GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
SEE ALSOThe full documentation for decorate is maintained as a Texinfo manual. If the info and decorate programs are properly installed at your site, the command
should give you access to the complete manual.
|