выполнить команду от имени другого пользователя (execute a command as another user)
Статус выхода (Exit)
Upon successful execution of a command, the exit status from sudo
will be the exit status of the program that was executed. If the
command terminated due to receipt of a signal, sudo
will send
itself the same signal that terminated the command.
If the -l
option was specified without a command, sudo
will exit
with a value of 0 if the user is allowed to run sudo
and they
authenticated successfully (as required by the security policy).
If a command is specified with the -l
option, the exit value will
only be 0 if the command is permitted by the security policy,
otherwise it will be 1.
If there is an authentication failure, a configuration/permission
problem or if the given command cannot be executed, sudo
exits with
a value of 1. In the latter case, the error string is printed to
the standard error. If sudo
cannot stat(2) one or more entries in
the user's PATH, an error is printed to the standard error. (If
the directory does not exist or if it is not really a directory,
the entry is ignored and no error is printed.) This should not
happen under normal circumstances. The most common reason for
stat(2) to return 'permission denied' is if you are running an
automounter and one of the directories in your PATH is on a machine
that is currently unreachable.