sebastiano.tronto.net

Source files and build scripts for my personal website
git clone https://git.tronto.net/sebastiano.tronto.net
Download | Log | Files | Refs | README

commit 9097eb1a23bda68260a4e8a4649db2573189dfd6
parent 901d19dd4f38c1865fc952a84f52f1c2bec14169
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Wed, 27 Mar 2024 07:52:35 +0100

Added blog post

Diffstat:
Msrc/blog/2024-02-20-head-and-tail/head-and-tail.md | 2++
Asrc/blog/2024-03-27-rev/rev.md | 20++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/blog/2024-02-20-head-and-tail/head-and-tail.md b/src/blog/2024-02-20-head-and-tail/head-and-tail.md @@ -95,3 +95,5 @@ anymore, but it was mentioning. These two utilities don't do much, but can accomplish a lot when combined with I/O redirection and other text filters. + +*Next in the series: [rev](../2024-03-27-rev)* diff --git a/src/blog/2024-03-27-rev/rev.md b/src/blog/2024-03-27-rev/rev.md @@ -0,0 +1,20 @@ +# UNIX text filters, part 2.3 of 3: rev + +*This post is part of a [series](../../series)* + +Of all the simple programs I am dedicating a post to in this series, +`rev` is probably the simplest of them all. So simple that it is +easy to forget about: `rev` prints each line of standard input to +standard output, reversing the order of the characters. For example: + +``` +$ printf 'This is\na very short post' | rev +si sihT +tsop trohs yrev a +``` + +Since [text is complicated](https://www.youtube.com/watch?v=gd5uJ7Nlvvo), +`rev` will read the environment variable `LC_CTYPE` to determine what +constitutes a character. + +And that's it. See you soon for another (longer) post in this series.