[R & Unix ..] system("test",...) gives funny results...

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 10 Dec 1998 16:35:32 +0100

Peter Dalgaard provided the solution:

1) system(.) always uses /bin/sh  -- not regarding $SHELL or anything

2) On Solaris 2.5.1,  the /bin/sh builtin 'test'  doesn't work as expected
   as expected with  "test -e  file" :

    sophie{maechler}654> uname -a
    SunOS sophie 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-1

    sophie{maechler}655> /bin/sh

    $ test -e /tmp
    test: argument expected
    $ touch /tmp/q
    $ test -e /tmp/q
    test: argument expected
    $ test -d /tmp; echo $?
    $ test -d /Tmp; echo $?

[still interested to hear about the potential of an R builtin 'test',
 relying on GNU sh-utils].

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