From 9097eb1a23bda68260a4e8a4649db2573189dfd6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 27 Mar 2024 07:52:35 +0100 Subject: Added blog post --- src/blog/2024-03-27-rev/rev.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/blog/2024-03-27-rev/rev.md (limited to 'src/blog/2024-03-27-rev') diff --git a/src/blog/2024-03-27-rev/rev.md b/src/blog/2024-03-27-rev/rev.md new file mode 100644 index 0000000..48678d1 --- /dev/null +++ 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. -- cgit v1.3