R/rsh.R

#' execute a command remotely via ssh
#'
#' @param cmd the command to execute
#' @param hostname the remote machine
#' @param username currently works with ssh keys rather than password
#' 
#' @export
rcmd <- function(cmd, hostname="troodon.scicom.picr.man.ac.uk",username="pschofield"){
  system(paste0("ssh -Y ",username,"@",hostname," '-l -c bash ",cmd,"'"),intern=T)
}
PietaSchofield/pietalib documentation built on May 8, 2019, 3:18 a.m.