summaryrefslogtreecommitdiff
path: root/bin/common/toush
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common/toush')
-rwxr-xr-xbin/common/toush10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/common/toush b/bin/common/toush
new file mode 100755
index 0000000..eb2d7cf
--- /dev/null
+++ b/bin/common/toush
@@ -0,0 +1,10 @@
+#!/bin/sh
+# idea from https://codeberg.org/futxlii/bin/toush :)
+
+shebang='#!/bin/sh'
+
+[ -f "$1" ] && exit 1
+
+printf '%s\n\n' "$shebang" > "$1" &&
+ chmod +x "$1" && $EDITOR "$1"
+grep -qv "$shebang\|^$" "$1" || rm "$1"