scripts/e

21 lines
286 B
Plaintext
Raw Permalink Normal View History

2023-11-21 11:55:39 +00:00
#!/bin/sh
set -e
editors=""
for editor in ed nex nvi vim; do
if command -v "$editor" >/dev/null; then
if test -z "$editors"; then
editors="$editor"
else
editors="$editors\n$editor"
fi
fi
done
random_editor="$(echo "$editors" | shuf | head -n 1)"
$random_editor "$@"