search for: system2

Displaying 20 results from an estimated 122 matches for "system2".

Did you mean: system
2019 Mar 18
4
Possibly broken system2 env-option
Hey all, what is wrong with this command: system2("echo", env = c(VAR = "Hello World"), args = c("$VAR")) I am a bit confused, as help("system2") writes about the env option: > character vector of name=value strings to set environment variables. Is this option buggy, or am I using it just wrong? Thank...
2019 Mar 19
2
Possibly broken system2 env-option
On Tue, Mar 19, 2019 at 9:59 AM peter dalgaard <pdalgd at gmail.com> wrote: [...] > What you need is something like (NB: single quotes!) > > system2("sh", env = c("VAR='Hello World'"), args = c("-c 'echo $VAR'")) > Hello World Just out of curiosity, do you think it is possible to make this portable, assuming sh is available? On Windows it gives > system2("sh", env = c("VAR=...
2010 Nov 11
1
Problem with system2(), directing STDERR to a file
According to ?system2, I should be able to direct the output of STDERR to a file by giving the filename as a character vector to the "stderr" argument. But here is what happens. Given a ruby script test.rb (with its executable bit set): #!/usr/bin/env ruby STDOUT.puts "stdout" STDERR.puts "st...
2018 Sep 14
2
Bug when calling system/system2 (and request for Bugzilla account)
I hope it's not too specific in my setup... I've tried with system2 added on the first line, so: Example.R: system2('ls', timeout=5) cat('Start non-interruptable functions\n') sample_a <- sample(1:1e7) sample_b <- sample(1:2e7) matching <- match(sample_a, sample_b) cat('Finished\n') Sys.sleep(10) And in terminal/bash: R --vanilla...
2019 Dec 15
1
system2 doesn't quote stdin on unix, unlike stdout, stderr & input and on Windows
Hi again! While investigating the bug report [*] I found out that on unix, system2 does not quote its `stdin` argument while preparing the command line to launch. It does shQuote the `stdout` and `stderr` arguments, and also the `f <- tmpfile()` variable (which is used if `input` argument is provided), which seems to set a precedent. On Windows, stdin, stdout, and stderr are...
2013 Sep 23
1
Capture output of install.packages (pipe system2)
Is there any way to capture output (both stdout and stderr) from install.packages? Solutions like sink and capture.output don't work because the install.packages calls out to system2 which is executed in a separate process: test <- capture.output(install.packages("MASS")) The system2 function does have arguments stdout and stderr but afaik these cannot be controlled via install.packages. I'm a bit reluctant to start rolling my own version of install.packa...
2018 Sep 14
0
Bug when calling system/system2 (and request for Bugzilla account)
FWIW I can reproduce on macOS with R 3.5.1. A smaller example: system2("ls", timeout = 5); x <- sample(1:1E8) If I try to interrupt R while that sample call is running, R itself is closed. Best, Kevin On Fri, Sep 14, 2018 at 10:53 AM Emil Bode <emil.bode at dans.knaw.nl> wrote: > > I hope it's not too specific in my setup... > I'...
2018 Sep 14
3
Bug when calling system/system2 (and request for Bugzilla account)
...press Ctrl-C while some functions are running that don?t catch the interrupt. However, the behaviour is different whether I?m in a clean session (in which case some time is allowed to pass, so that when the function returns the script can be interrupted), or whether I have called base::system() or system2() with timeout other than 0. Reproducible example: cat('Start non-interruptable functions\n') sample_a <- sample(1:1e7) sample_b <- sample(1:2e7) matching <- match(sample_a, sample_b) cat('Finished\n') Sys.sleep(10) Observed behaviour: In a clean session, when I hit Ctrl-...
2016 Aug 09
4
ssh & ksh question
I need to run a report, source file on system 1, on system 2. I'd like to do this in one script, not have a second script to run it. Now cat script | ssh system2 works fine. But no matter what I've tried, it gags on ssh system2 <<EOF blah, blah EOF. Mostly, I have a multiline awk script in the script, with \ at the end of each line... *but* I think it's seeing "\n" as an eol, and complaining, of course. Suggestions? mark
2015 Jun 24
0
system2() shortens R.home() to 8.3 form on windows
Hi, So in an interactive R session, R.home() returns the following: > R.home() [1] "D:/biocbld/bbs-3.2-bioc/R" However, if I call it from system2(), I get different results: > system2("R", "-q -e R.home()") > R.home() [1] "D:/biocbld/BBS-3~1.2-B/R" Similarly: > system2("R", "-q -e Sys.getenv('R_HOME')") > Sys.getenv('R_HOME') [1] "D:/biocbld/BBS-3~1.2-B/R&q...
2016 Dec 06
0
system2 fails with quiet=TRUE, but runs through with quiet=FALSE
...> covr::package_coverage() fails, while > covr::package_coverage(quiet = FALSE) runs through without problem. I traced the problem to a call to utils::install.packages(), where the option quiet is passed on. In utils::install.packages(), the problem seems to lie in the following call of system2(): output <- if (quiet) FALSE else "" [...] status <- system2(cmd0, args, env = env, stdout = output, stderr = output) Manually changing stdout to "" makes the program run through without error (but then the output is there again, of cou...
2019 Mar 19
0
Possibly broken system2 env-option
You are using it wrong. It wants strings of the form "name=value", not a character vector with names as labels. So this is closer to the mark: > system2("echo", env = c("VAR='Hello World'"), args = c("$VAR")) > However, as you see it doesn't work as intended. The problem is that the $-substitution refers to the environment of the shell executing the command. I.e. this does not work from a terminal comm...
2019 Mar 19
0
Possibly broken system2 env-option
On Windows, ?env? is only supported for commands such as ?R? and ?make? which accept environment variables on their command line. So I suppose that would be tricky. The basic issue is that on Unix-alikes, system2 constructs a command like FOO=bar cmd args and passes that to sh via system(). On windoes, system() does not call sh, so system2() does (effectively) cmd FOO=bar args and hopes that cmd knows what to do with the env setting. -pd > On 19 Mar 2019, at 11:09 , G?bor Cs?rdi <csardi.gabor at...
2013 Jul 14
1
Redirect system2 stdout to a file on windows
According to the manual, the `stdout` argument of the `system2` function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no `out.txt` or `err.txt` files are created. I tried sending it to an existing file, or expand the full file path, but with no success: setwd(tempdir())...
2018 Jan 26
2
utils::install.packages with quiet=TRUE fails for source packages on Windows
..., Installing a source package on Windows using utils::install.packages() with quiet=TRUE fails, while it works with the default quiet = FALSE. The problem seems to be caused by the fact that when quiet = TRUE, stdout and stderr are set to FALSE when calling "R CMD INSTALL" with base::system2() here: https://github.com/wch/r-source/blob/tags/R-3-4-3/src/library/utils/R/packages2.R#L660-L661. > trace(base::system2, quote(print(ls.str()))) Tracing function "system2" in package "base" [1] "system2" > utils::install.packages("partDF_1.0.0.9001.ta...
2018 Sep 14
0
Bug when calling system/system2 (and request for Bugzilla account)
I can't reproduce this. Can you be more precise: exactly where are you putting the system2 call and exactly where are you sending the interrupt signal with ^C? Best, luke On Fri, 14 Sep 2018, Emil Bode wrote: > Hi all, > > I found some strange behaviour, which I think is a bug. Could someone make an account for me on Bugzilla or pass on my report? > > The problem: >...
2010 Oct 02
1
cleanup_pkg() in tools:::.build_packages() is broken
Hi, The cleanup_pkg() function defined the big tools:::.build_packages() function in tools/R/build.R is currently broken. When Makefiles are used cleanup_pkg() doesn't clean anything because of the way system2() is called. For example, the call to Ssystem() on line 304 (Ssystem is a silent version of system2) is basically trying to do this: > system2(paste(Sys.getenv("MAKE", "make"), makefiles, "clean")) sh: make -f '/home/hpages/R-2.12/etc//Makeconf' -f M...
2015 May 18
4
How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?
...sire to use the function plotdiff() from Paul Murrell's gridGraphics package on my Windows laptop. Getting that to work will require a few code fixes, of which the masking of ImageMagick's convert.exe by that in the C:/Windows/System32 seems to be the most challenging. plotdiff() relies on system2() calls to ImageMagick's 'convert' function, as well as a call to Sys.which(c("convert", "compare")) that tests for the presence of ImageMagick on the Path. Even if ImageMagick is placed early on the Path, though, both calls to Sys.which() and system2() find Window...
2010 Nov 02
1
system() and system2() functions
...much info on this in the change logs/release notes, but from what I have found I am under the impression that system() no longer "shell quotes" the command passed to it (if I "shQuote()" the command the code runs fine). I also see from the help files that a new function "system2()" has been introduced which takes a different set of arguments and appears to be under development (from the help page: "system2is the beginnings of a more portable interface than system"). Since I assume there to be good reasons for this change to system I'm happy to spend...
2018 Jan 26
1
utils::install.packages with quiet=TRUE fails for source packages on Windows
...t;> Installing a source package on Windows using utils::install.packages() with quiet=TRUE fails, while it works with the default quiet = FALSE. The problem seems to be caused by the fact that when quiet = TRUE, stdout and stderr are set to FALSE when calling "R CMD INSTALL" with base::system2() here: https://github.com/wch/r-source/blob/tags/R-3-4-3/src/library/utils/R/packages2.R#L660-L661. >>> trace(base::system2, quote(print(ls.str()))) >> Tracing function "system2" in package "base" >> [1] "system2" >>> utils::install.pack...