aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-05-02 00:26:25 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-05-02 00:26:25 +1200
commitb7e47b0941ebd056f75bbf2d4a2e09a672b24170 (patch)
tree9f953f242748b207e518338a179caf928c517e39 /bin
parentFix a misplaced line (diff)
downloaddotfiles-b7e47b0941ebd056f75bbf2d4a2e09a672b24170.tar.gz
dotfiles-b7e47b0941ebd056f75bbf2d4a2e09a672b24170.zip
Clean up clog(1df) a bit
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/clog.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/clog.sh b/bin/clog.sh
index 0964ce90..b17ff1c5 100644..100755
--- a/bin/clog.sh
+++ b/bin/clog.sh
@@ -1,7 +1,16 @@
+#!/bin/sh
# Record a timestamped message to a logfile, defaulting to ~/.clog
self=clog
+
+# Ignore arguments
+set --
+
+# If we have rlwrap, quietly use it
command -v rlwrap >/dev/null 2>&1 &&
set -- rlwrap -C "$self" "$@"
+
+# Write the date, the standard input (rlwrapped if applicable), and two dashes
+# to $CLOG, defaulting to ~/.clog.
{
date
"$@" cat -