Skip to content

sudo

Run direct commands or block-scoped operations with elevated privileges via sudo.

Functions

run cmd :user? ...args

Run a verbatim command through sudo.

Pass user to run as a user other than root.

Example: ``` i

with func :user?

Run a function with elevated privileges via sudo.

Filesystem access and spawned programs will be redirected for the duration of the function.

Pass user to run as a specific user instead of root.

Example:

import fs
let shadow = sudo.with do fs.read /etc/shadow