Rev 33605 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{Sys.getenv}\title{Get Environment Variables}\usage{Sys.getenv(x)}\alias{Sys.getenv}\arguments{\item{x}{a character vector, or missing}}\description{\code{Sys.getenv} obtains the values of the environment variables named by\code{x}.}\value{A vector of the same length as \code{x}, with the variable names asits \code{names} attribute. Each element holds the value of theenvironment variable named by the corresponding component of \code{x}(or \code{""} if no environment variable with that name was found).On most platforms \code{Sys.getenv()} will return a named vector givingthe values of all the environment variables.}\seealso{\code{\link{Sys.putenv}},\code{\link{Sys.getlocale}} for the locale \dQuote{environment},\code{\link{getwd}} for the working directory.}\examples{## whether HOST is set will be shell-dependent e.g. Solaris' csh does not.Sys.getenv(c("R_HOME", "R_PAPERSIZE", "R_PRINTCMD", "HOST"))str(s <- Sys.getenv()) # all settings (rather do not print)## Language and Locale settings -- but rather use Sys.getlocale()s[grep("^L(C|ANG)", names(s))]}\keyword{environment}\keyword{utilities}