cut in Shell Scripts: Delimiters, Character Sets, and Record Assumptions
Use cut only for the record format it understands, distinguishing bytes, characters, fields, locale effects, and arbitrary filename boundaries.
tag
10 posts
Use cut only for the record format it understands, distinguishing bytes, characters, fields, locale effects, and arbitrary filename boundaries.
Use Fish's string builtin with deliberate glob or regex modes, literal replacement, stream boundaries, and output semantics that scripts can test.
Handle grep's match, no-match, and error statuses explicitly while preserving filenames, pipeline failures, and predictable regular-expression behavior.
Use nl to number selected lines in document sections, while preserving the distinction between presentation labels and stable record identifiers.
Use paste for line-oriented column assembly, while making input alignment, delimiter cycling, missing records, and text-format limits explicit.
Choose portable sed edits, account for GNU and BSD in-place option differences, and replace files only after validated transformations succeed.
Use tr for character translation, squeezing, and deletion without assuming Unicode normalization, multibyte portability, or arbitrary-byte semantics.
Use FreeDOS FIND for literal line searches, case handling, counts, inversion, and safe batch decisions without treating it as a regular-expression tool.
Use FreeDOS SORT with explicit input, key columns, NLS, and ASCII ordering, while accounting for memory limits and repeatable output.
Follow Perl from Larry Wall's 1987 release through text processing, regular expressions, CPAN, Perl 5, and the community model that sustained it.