summary refs log tree commit diff
path: root/bin/edit.sh
blob: c276707fd3d1af1d218f4789c932af3dac56c11c (plain) (blame)
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"