blob: eb2d7cfc38bfd967a2c4aceb26c3fe7b588abf2f (
plain)
1
2
3
4
5
6
7
8
9
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"
|