Add script to invoke random editor

This commit is contained in:
The Magician 2023-11-21 11:55:39 +00:00
parent c2cba29bb1
commit 4d7fe9779f
1 changed files with 20 additions and 0 deletions

20
e Executable file
View File

@ -0,0 +1,20 @@
#!/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 "$@"