modifyPathString: System path string handlers

modifyPathStringR Documentation

System path string handlers

Description

System path string handlers

Usage

addToPathEnd(x, var = "PATH")

addToPathStart(x, var = "PATH")

removeFromPath(x, var = "PATH")

Arguments

x

character. Elements to add to the system path string defined in var.

var

character(1). System environment variable name. Hands off to Sys.getenv and Sys.setenv internally. Intended for use with "PATH", "FPATH", "MANPATH", etc.

Value

Invisible character(1). Path string.

Functions

  • addToPathEnd(): Note that input defined in x is reversed internally, so the first element in the vector is added to the end of the path string.

Note

Updated 2021-08-23.

Examples

x <- c("/usr/local/bin", "/usr/bin")
var <- "TESTPATH"
Sys.unsetenv(var)

addToPathEnd(x = x, var = var)
Sys.getenv(var)

removeFromPath(x = x, var = var)
Sys.getenv(var)

addToPathStart(x = x, var = var)
Sys.getenv(var)

acidgenomics/AcidBase documentation built on Jan. 28, 2024, 2:59 a.m.