Skip to contents

u.sys() is a convenient wrapper (of system()) to call to the underlying operating system. The main purpose has been to provide a function with identical UI both in S-PLUS and R. MM thinks you shouldn't use this anymore, usually.

Sys.ps.cmd() returns the ps (‘process status’) OS command name (as character string), and is typically usable on unix alikes only.

Usage

u.sys(..., intern = TRUE)

Sys.ps.cmd()

Arguments

...

any number of strings – which will be paste()d together and passed to system.

intern

logical – note that the default is reversed from the one in system().

Author

Martin Maechler

See also

system, really!; on non-Windows, Sys.ps() which makes use of Sys.ps.cmd().

Examples

u.sys # shows how simply the function is defined :
#> function (..., intern = TRUE) 
#> system(paste0(...), intern = intern)
#> <bytecode: 0x5ec1bbb60618>
#> <environment: namespace:sfsmisc>
if (FALSE) { # \dontrun{
  function (..., intern = TRUE)
  system(paste(..., sep = ""), intern = intern)
} # }

# All *running* processes of user [sometimes only R]:
try ( u.sys(Sys.ps.cmd(), "ur") )
#> Warning: running command '/bin/ps wur' had status 1
#> [1] "USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND"
#> attr(,"status")
#> [1] 1