shQuote
Quote Strings for Use in OS Shells

Description

Applies quotation marks and escape characters to strings so that they may be safely passed to operating system shells.

Usage

shQuote(string, type = c("sh", "csh", "cmd"))

Arguments

string a vector of character strings.
type the operating system shell type. Can be "sh", "csh" or "cmd". If this value is missing and the operating system is Windows, it is set to "cmd".

Details

Value
returns the quoted string.
Examples

shQuote(getwd()) shQuote('foo/bar.txt', type="sh") # [1] "'foo/bar.txt'" shQuote('foo\bar.txt', type="cmd") # [1] "\"foo\bar.txt\""

Package base version 6.1.1-7
Package Index