#!/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"