1 2 3 4 5 6 7 8 9
#!/bin/sh set -eu script=$(mktemp) trap "rm -f '$script'" EXIT sed "s/.*/${1:-: &}/" >> "$script" $EDITOR "$script" sh -eux "$script"