summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/head_-c_-19
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/head_-c_-1 b/scripts/head_-c_-1
new file mode 100755
index 0000000..b2e7916
--- /dev/null
+++ b/scripts/head_-c_-1
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+#This script is necessary because head from GNU textutils 2.0 (on Borg's
+# machine) doesn't implement negative arguments for the -n and -c options.
+
+#FIXME: The emulation here fails if there's a newline at the end:
+#sed '$s/.$//'
+
+rev | tac | dd bs=1 skip=1 status=noxfer 2>/dev/null | tac | rev