If you use backslashes to escape single or double quotes in a .Renviron file, then readRenviron will omit the first backslashed quote but respect the others. Here is a function to compare how readRenviron and bash (assumed to be on your PATH) treat lines in a .Renviron file. testRenviron <- function(envVarDef, tryBash = FALSE, envVarName = "wwd_5592") { tf<-tempfile() Sys.unsetenv(envVarName) on.exit({Sys.unsetenv(envVarName); unlink(tf)}) cat(file=tf, sep="", envVarName, "=", envVarDef, "\n") readRenviron(tf) value <- Sys.getenv(envVarName, unset="<not set>") Sys.unsetenv(envVarName) if (tryBash) { attr(value, "bashValue") <- system(paste0("bash -c ' . ", normalizePath(tf, winslash="/"), "; echo $", envVarName, "; '"), intern=TRUE) } value } They give the same results in most cases where the definition is legal in bash > testRenviron("${R_HOME-R_HOME is not defined}", tryBash=TRUE) [1] "/opt/sw/R/R-3.2.0/lib64/R" attr(,"bashValue") [1] "/opt/sw/R/R-3.2.0/lib64/R" > testRenviron("${T_HOME-T_HOME is not defined}", tryBash=TRUE) [1] "T_HOME is not defined" attr(,"bashValue") [1] "T_HOME is not defined" > testRenviron("\"T_HOME is not defined\"", tryBash=TRUE) [1] "T_HOME is not defined" attr(,"bashValue") [1] "T_HOME is not defined" and R is a little more lenient about quotes than bash is > testRenviron("T_HOME is not defined", tryBash=TRUE) /tmp/RtmpY3wqim/file423b5464e774: line 1: is: command not found [1] "T_HOME is not defined" attr(,"bashValue") [1] "" However, if you try to escape some quotes with backslashes R drops the first backslashed quote (single or double) where bash treats them all the same. > testRenviron("${LAWYERS-O\\'Malley, O\\'Finnegan, and O\\'Clock}", tryBash=TRUE) [1] "OMalley, O'Finnegan, and O'Clock" attr(,"bashValue") [1] "O'Malley, O'Finnegan, and O'Clock" > testRenviron("${STATEMENT-She said \\\"Hello\\\"}", tryBash=TRUE) [1] "She said Hello\"" attr(,"bashValue") [1] "She said \"Hello\"" If both kinds of quotes are escaped odder things happen > testRenviron("${STATEMENT-She\\'d said \\\"Hello\\\"}", tryBash=TRUE) [1] "Shed said \\\"Hello\\\"" attr(,"bashValue") [1] "She'd said \"Hello\""