diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-04 22:45:56 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-04 22:45:56 +0200 |
commit | 1914d16f1693a3c31f8ad9e07b1469df1604d690 (patch) | |
tree | a8a623823adc077f7371de379b9e70eb7a7b485c /bin/common/toush | |
parent | 49bbf6906089b5d957e2a781002d32b811ae630d (diff) | |
parent | e850f3a1702b4d8b9d0cfec5c07d710b5201ed29 (diff) |
Merge branch 'main' of /var/git/dotfiles
Diffstat (limited to 'bin/common/toush')
-rwxr-xr-x | bin/common/toush | 10 |
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" |