diff options
| -rw-r--r-- | src/blog/2024-02-20-head-and-tail/head-and-tail.md | 2 | ||||
| -rw-r--r-- | src/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 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 | ||
| 96 | These two utilities don't do much, but can accomplish a lot when combined | 96 | These two utilities don't do much, but can accomplish a lot when combined |
| 97 | with I/O redirection and other text filters. | 97 | with 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 | |||
| 5 | Of 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 | ||
| 7 | easy to forget about: `rev` prints each line of standard input to | ||
| 8 | standard output, reversing the order of the characters. For example: | ||
| 9 | |||
| 10 | ``` | ||
| 11 | $ printf 'This is\na very short post' | rev | ||
| 12 | si sihT | ||
| 13 | tsop trohs yrev a | ||
| 14 | ``` | ||
| 15 | |||
| 16 | Since [text is complicated](https://www.youtube.com/watch?v=gd5uJ7Nlvvo), | ||
| 17 | `rev` will read the environment variable `LC_CTYPE` to determine what | ||
| 18 | constitutes a character. | ||
| 19 | |||
| 20 | And that's it. See you soon for another (longer) post in this series. | ||
