Есть ли у sudo опция, подавляющая сообщения об ошибках?
$ echo|sudo -p '' -S echo 123
Sorry, try again.
sudo: 1 incorrect password attempt
$ yes 123|sudo -p '' -S echo 123
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts
$ (yes 123|sudo -p '' -S echo 123) 2>&1 > /dev/null
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts