maechler@stat.math.ethz.ch
2000-May-19 19:11 UTC
[Rd] system(.., ignore.stderr = TRUE) problem on Solaris (PR#547)
(i.e. my version Solaris, see below...) Note that system() is not only implemented quite system-dependently (which you'd very much expect!) but also Unix and Windows have quite different arguments apart from the first two. Hence all the following is ``Unix-only'' : A user stumbled across this when using read.table.url(.) on a platform where no "wget" is installed: The data is read ok, but an ugly message appears *before* the command is completed : ------------------- sh: wget: not found ------------------- which made the user believe that the data wasn't read properly. The problem is easily tracked to the system(..) call in download.file() {which does not (yet) have the "ignore.stderr = TRUE" setting, btw} and found that on our Solaris environment, the ignore.stderr argument does not seem to have any effect, i.e. > system("bla", ignore.stderr = TRUE) gives the same as system("bla"), namely sh: bla: not found On my Linux environment, ignore.stderr works as advertized. Further note that help(system) should probably also say something about which shell may or may not be used (I think we decided that we want it to be `sh' on Unix). --please do not edit the information below-- {did anyway ;=)} Version: platform = sparc-sun-solaris2.5.1 arch = sparc os = solaris2.5.1 system = sparc, solaris2.5.1 --- either R-devel of today, or also 1.0.1 --- year = 2000 month = May day = 18 language = R Search Path: .GlobalEnv, package:SfS, Autoloads, package:base -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
2000-May-19 21:46 UTC
[Rd] system(.., ignore.stderr = TRUE) problem on Solaris (PR#547)
On Fri, 19 May 2000 maechler@stat.math.ethz.ch wrote:> (i.e. my version Solaris, see below...) > > Note that system() is not only implemented quite system-dependently > (which you'd very much expect!) but also Unix and Windows have quite > different arguments apart from the first two. > > Hence all the following is ``Unix-only'' : > > > A user stumbled across this when using read.table.url(.) on a platform > where no "wget" is installed: > > The data is read ok, but an ugly message appears *before* the command is > completed : > ------------------- > sh: wget: not found > ------------------- > which made the user believe that the data wasn't read properly. > > The problem is easily tracked to the system(..) call in download.file() > {which does not (yet) have the "ignore.stderr = TRUE" setting, btw} > and found that on our Solaris environment, > the ignore.stderr argument does not seem to have any effect, i.e. > > > system("bla", ignore.stderr = TRUE) > > gives the same as system("bla"), namely > > sh: bla: not foundUnder sh you cannot redirect the output from a command until the command is running. That is, you are not redirecting the error messages from sh, only from the command. Unless the command runs, ignore.stderr has no effect.> On my Linux environment, ignore.stderr works as advertized.Depends how you read the advertising.> Further note that help(system) should probably also say something about which > shell may or may not be used (I think we decided that we want it to be `sh' > on Unix).Yes, and you almost certainly got bash *not* sh on your Linux, and that behaves differently. I think you will find that a closer sh clone (such as ash) does show the error message. That some Linux systems claim to have sh and do not is a major compatibility problem in writing shell scripts and Makefiles, as we keep finding. BTW, Solaris will use ksh not sh for the shell if it needs to be POSIX compatible. And ksh behaves like bash in this respect. I believe that to define this portably we are going to have to do something a lot more complicated than accept what the system() call gives us. Are you volunteering, Martin? -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._