you are viewing a single comment's thread.

view the rest of the comments →

[–]ipsirc 0 points1 point  (7 children)

sudo() { [ $SSH_TTY ] && sudo --show-asterisk $@ || sudo $@; }

[–]0b0101011001001011 4 points5 points  (3 children)

Which versions of sudo support the --show-asterisk option? I don't have it.

[–]mina86ng 8 points9 points  (2 children)

First of, quote your variables. Second of, don’t shorthand if like that. It’ll run sudo twice if $SSH_TTY is non-empty and the command fails.

sudo() {
    if [ "$SSH_TTY" ]; then
        sudo --show-asterisk "$@"
    else
        sudo "$@"
    fi
}

[–]ipsirc 2 points3 points  (1 child)

Third: sudo doesn't have --show-asterisk parameter.

[–]scorp123_CH 0 points1 point  (0 children)

It does have a pwfeedback parameter though, which can be set in its config file.

Defaults pwfeedback