Skip to main content

pack_sudo

Function pack_sudo 

Source
pub fn pack_sudo(
    command: &str,
    sudo_password: Option<&SecretString>,
) -> PackedCommand
Expand description

Packs a command for sudo with sh -c.

  • With password: sudo -S -p '' sh -c 'cmd' and password on the channel stdin (not argv).
  • Sem password: sudo -n sh -c 'cmd'.