aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-03-27 07:52:35 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-03-27 07:52:35 +0100
commit9097eb1a23bda68260a4e8a4649db2573189dfd6 (patch)
treeb89baa56f316fab0f50e4959bc4bdf5322ad30fa
parent901d19dd4f38c1865fc952a84f52f1c2bec14169 (diff)
downloadsebastiano.tronto.net-9097eb1a23bda68260a4e8a4649db2573189dfd6.tar.gz
sebastiano.tronto.net-9097eb1a23bda68260a4e8a4649db2573189dfd6.zip
Added blog post
-rw-r--r--src/blog/2024-02-20-head-and-tail/head-and-tail.md2
-rw-r--r--src/blog/2024-03-27-rev/rev.md20
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
index bce2fbe..afda382 100644
--- 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.
95 95
96These two utilities don't do much, but can accomplish a lot when combined 96These two utilities don't do much, but can accomplish a lot when combined
97with I/O redirection and other text filters. 97with I/O redirection and other text filters.
98
99*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
new file mode 100644
index 0000000..48678d1
--- /dev/null
+++ b/src/blog/2024-03-27-rev/rev.md
@@ -0,0 +1,20 @@
1# UNIX text filters, part 2.3 of 3: rev
2
3*This post is part of a [series](../../series)*
4
5Of all the simple programs I am dedicating a post to in this series,
6`rev` is probably the simplest of them all. So simple that it is
7easy to forget about: `rev` prints each line of standard input to
8standard output, reversing the order of the characters. For example:
9
10```
11$ printf 'This is\na very short post' | rev
12si sihT
13tsop trohs yrev a
14```
15
16Since [text is complicated](https://www.youtube.com/watch?v=gd5uJ7Nlvvo),
17`rev` will read the environment variable `LC_CTYPE` to determine what
18constitutes a character.
19
20And that's it. See you soon for another (longer) post in this series.

Generated with cgit - Back to sebastiano.tronto.net