core/exec

Command execution support library

Dependency Graph

core/exec: Library Dependencies

View color source code (raw) for this file

View reStructuredText (rst) source code for this page

The run Function

run()

Encapsulates the running of commands in a way that allows them to be logged, simulated, and handled gracefully when not present.

This function should be called whenever invoking an external program, calling functions that makes changes to disk, and any other location where such handling would be necessary to preserve its feature set.

$1 - Name of command to run

$@ - Command arguments

sudo Commands

run_sudo()

Same as run(), but run under sudo -H

run_sudo_as_user()

Same as run_sudo(), but run as a given user ($1)

run_sudo_install()

Same as run_sudo(), but runs install on with the given mode ($1), owner ($2), and group ($3).

seed_sudo()

Updates sudo timestamp, making it unlikely that subsequent calls to sudo will require a password. This may also be called periodically to ensure the timestamp remains valid across long command invocations

sudo_pipe_to_file()

Pipes stdin to a temporary file and then uses sudo to move it the named file ($1).

$1 - Name of target file

External Commands

run_editor()

Runs $EDITOR with the provided arguments

run_pager()

Runs $PAGER with the provided arguments


View the Developer Guide Index

View the Reference Manual Index


Generated on Sat Jul 8 19:33:42 PDT 2017 by mcsh d14 v0.22.0.