Есть ли у 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
man sudo не помог,
$ man -P cat sudo | grep -E -ie '(quiet|verbose)' host. A longer list format is used if this option is specified multiple times and the security policy supports a verbose output format. the -V option will display the arguments passed to configure when sudo was built and plugins may display more verbose information such as default