From 3801872c05edd04fa51cf70455cc445012da2fd2 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Mon, 11 Mar 2024 21:47:51 +0300 Subject: [PATCH] Su : Add sudo for su -c. --- module/common/bash/module/Su.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/common/bash/module/Su.sh b/module/common/bash/module/Su.sh index db2eb788..74b45b2f 100644 --- a/module/common/bash/module/Su.sh +++ b/module/common/bash/module/Su.sh @@ -2,10 +2,17 @@ # Root by default. # Usage: s [USER] function s() { - su - "${@}" + su - "${1}" +} + +# Run something as root. +# Usage: sudo +function sudo() { + su -c "${*}" } function _complete_s() { _autocomplete "voronind" "dasha" } complete -F _complete_s s +complete -F _autocomplete_nested sudo