aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-26 23:25:30 -0300
committerEuAndreh <eu@euandre.org>2021-01-26 23:33:56 -0300
commit3ceb67074fc2fb64fced7beb3730f1666be7d537 (patch)
tree2e5ad415de2695bdca4007bf3eeadfb629a25461
parentremembering: Add -V version flag, add missing docs on -h flag (diff)
downloadremembering-0.1.2.tar.gz (sig)
remembering-0.1.2.tar.xz
v0.1.2: Use sed over tac for POSIX compatibilityv0.1.2
TODOs.md: Mark #task-98478c0f-97ac-4667-acdc-9373e2841de9 as done
-rw-r--r--CHANGELOG.md4
-rw-r--r--Makefile2
-rw-r--r--TODOs.md5
-rwxr-xr-xremembering5
4 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7a58444..7d109b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@
## Security
-->
+# 0.1.2 - 2021-01-26
+## Fixed
+Replace usage of GNU Coreutils' specific `tac` utility with `sed`.
+
# 0.1.1 - 2021-01-26
## Fixed
Allow names with spaces.
diff --git a/Makefile b/Makefile
index 6b6ca51..d159a5b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.POSIX:
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
-VERSION = v0.1.1
+VERSION = v0.1.2
DATE = 2021-01-26
all:
diff --git a/TODOs.md b/TODOs.md
index 450d214..9828c1d 100644
--- a/TODOs.md
+++ b/TODOs.md
@@ -1,12 +1,15 @@
# Tasks
-## TODO Is tac POSIX {#task-98478c0f-97ac-4667-acdc-9373e2841de9}
+## DONE Is tac POSIX {#task-98478c0f-97ac-4667-acdc-9373e2841de9}
+- DONE in 2021-01-26
- TODO in 2021-01-26
---
If it isn't, what to replace it with?
+With [sed](https://unix.stackexchange.com/questions/280685/reverse-sequence-of-a-file-with-posix-tools/280686#comment601716_280686).
+
## DONE Add CHANGELOG.md for 0.1.0 {#task-f4258dc4-22aa-408d-a0b1-953f654e0623}
- DONE in 2021-01-26
- TODO in 2021-01-24
diff --git a/remembering b/remembering
index 0e3f29a..b7c23ae 100755
--- a/remembering
+++ b/remembering
@@ -79,9 +79,12 @@ FILTERED="$(mktemp)"
SORTED_STDIN="$(mktemp)"
cat | sort -u > "$SORTED_STDIN"
+# sed line to reverse lines, replacing GNU/Linux's tac
+# Taken from:
+# https://unix.stackexchange.com/questions/280685/reverse-sequence-of-a-file-with-posix-tools/280686#comment601716_280686
xargs -I{} printf '0:%s\n' "{}" < "$SORTED_STDIN" | \
sort -t: -k2,2 -m - "$PROFILE" | \
- tac | \
+ sed '1!x;H;1h;$!d;g' | \
sort -t: -k2,2 -u > "$MERGED"
xargs -I{} printf 'filter_marker:%s\n' "{}" < "$SORTED_STDIN" | \