I require the number of Firefox processes running on Linux (Ubuntu) be stored in a variable in an R script. By itself the system2 command I use seems to work. However, when I add stdout = TRUE
to capture the info in a character vector I get a warning. Why the warning?
system2(command = "ps", args = "aux | grep [f]irefox -c")
# 0
system2(command = "ps", args = "aux | grep [f]irefox -c", stdout = TRUE)
Warning message:
In system2(command = "ps", args = "aux | grep [f]irefox -c", stdout = TRUE) :
running command ''ps' aux | grep [f]irefox -c' had status 1