Namespace src/Linux/Sudo

src/Linux/Sudo

Overview

Directory src/Linux/Sudo

file source src/Linux/Sudo/asUser.sh

Linux::Sudo::asUser

execute command passed as arguments using sudo if current user is not already the targeted user

Arguments
  • (args:String[]): the command to execute as sudo
Environment variables
  • USERNAME (String): sudo as this user (root by default)
Exit codes
  • 1: exit code of command
Requires
  • Linux::requireSudoCommand

src/Linux/Sudo/asUserInheritEnv.sh

file source src/Linux/Sudo/asUserInheritEnv.sh

Linux::Sudo::asUserInheritEnv

execute command passed as arguments using sudo with environment inherited if current user is not already the targeted user

Arguments
  • (args:String[]): the command to execute as sudo
Environment variables
  • USERNAME (String): sudo as this user (root by default)
Exit codes
  • 1: exit code of sudo command
Requires
  • Linux::requireSudoCommand
Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.