mirror of
https://github.com/jarun/nnn.git
synced 2024-11-27 21:31:30 +00:00
17 lines
312 B
Bash
Executable file
17 lines
312 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Description: Edit file as superuser
|
|
#
|
|
# Shell: POSIX compliant
|
|
# Author: Anna Arad
|
|
|
|
EDITOR="${EDITOR:-vim}"
|
|
|
|
if type sudo >/dev/null 2>&1; then
|
|
sudo "$EDITOR" "$1"
|
|
elif type sudoedit >/dev/null 2>&1; then
|
|
sudoedit "$1"
|
|
elif type doas >/dev/null 2>&1; then
|
|
doas "$EDITOR" "$1"
|
|
fi
|