Su : Redir command output to the void.

This commit is contained in:
Dmitry Voronin 2024-03-13 13:07:28 +03:00
parent 859121ff85
commit 00cdaba802

View file

@ -8,7 +8,7 @@ function s() {
# Run something as root. Runs command as a current user if su is not available.
# Usage: sudo <COMMAND>
function sudo() {
if command -v su; then
if command -v su &> /dev/null; then
su -c "$(echo ${*} | tr '\n' ' ')"
else
${*}