summaryrefslogtreecommitdiff
path: root/.local/bin/shorts/append-to-history
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/shorts/append-to-history')
-rwxr-xr-x.local/bin/shorts/append-to-history5
1 files changed, 5 insertions, 0 deletions
diff --git a/.local/bin/shorts/append-to-history b/.local/bin/shorts/append-to-history
new file mode 100755
index 0000000..7d23dc8
--- /dev/null
+++ b/.local/bin/shorts/append-to-history
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -n "$1" ] || exit
+sed -i "\|^${1}$|d" "${2}"
+echo "$1" >> "$2"