[ESS] Weirdness after system("phpscript")

Rodney Sparapani rsparapa at mcw.edu
Mon Aug 2 17:14:27 CEST 2010

On 07/31/10 01:51 AM, Sven Hartenstein wrote:
> Dear ESS users and developers,
> I experience problems with ESS after running a php script by use of
> the system() function. I can't find this problem with any non-php
> script.
> Two things change after calling system(): First, in the R process
> buffer the commands are suddenly echoed like this:
>> x<- 1:4
>> t<- system("/some/phpscript.php", intern=TRUE)
>> x<- 1:4  # the following line should not be there
> x<- 1:4
>> x  # the following line should not be there
> x
> [1] 1 2 3 4
> Second, when I now create a help buffer, each line ends with a visible
> "^M". An encoding problem?
> Both is very annoying and I have no clue where the problem is coming
> from. It happens with and without "intern=TRUE", it happens with
> direct call of a PHP script and even when calling a bash script that
> itself calls the PHP script. But not when calling other bash scripts
> that would not internally call a PHP script. It happens with ESS 5.4
> and ESS-5.11 on Ubuntu 9.10 as well as ESS 5.7.1 on Ubuntu 10.4.
> Any help greatly appreciated!
> Sven

Hi Sven:

Speaking as someone who knows next to nothing about PHP, I'm guessing 
that it is altering the terminal settings.  This is often done by
the stty command.  Try issuing system("stty") before and after the
rogue command.


More information about the ESS-help mailing list