[R] system call removes special characters from text output

stephen sefick ssefick at gmail.com
Wed Apr 5 23:20:11 CEST 2017


Don,

Thank you for your reply. I found no problems in the perl script, but I
found that I had inadvertently swapped file names in my call to system("
script.pl file1 file2") works as expected system(script.pl file2 file1)
produces the output that formed my original query.

Thanks so much, and I learned to not code after 10 PM.
kindest regards,

Stephen

On Wed, Apr 5, 2017 at 4:06 PM, MacQueen, Don <macqueen1 at llnl.gov> wrote:

> I can't reproduce this.
>
> On my system, the contents of an executable file named tmp.pl:
>
> #! /opt/local/bin/perl
> print "[A/B]\n";
>
> At a shell prompt:
>
> [72]% ./tmp.pl
> [A/B]
>
> Inside R:
>
> > system(' ./tmp.pl')
> [A/B]
>
>
> --
> Don MacQueen
>
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
>
>
> On 4/3/17, 8:57 PM, "R-help on behalf of stephen sefick" <
> r-help-bounces at r-project.org on behalf of ssefick at gmail.com> wrote:
>
>     Hello,
>
>     I am writing an R package, and I am using system() to call a perl
> script.
>     The output of the perl script is correct except for "[A/B]" is output
> as
>     "AB". Can someone explain this behavior. I would like to try and fix
> this.
>     many thanks,
>
>     Stephen Sefick
>
>     --
>     Let's not spend our time and resources thinking about things that are
> so
>     little or so large that all they really do for us is puff us up and
> make us
>     feel like gods.  We are mammals, and have not exhausted the annoying
> little
>     problems of being mammals.
>
>                                     -K. Mullis
>
>     "A big computer, a complex algorithm and a long time does not equal
>     science."
>
>                                   -Robert Gentleman
>
>         [[alternative HTML version deleted]]
>
>     ______________________________________________
>     R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>     https://stat.ethz.ch/mailman/listinfo/r-help
>     PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
>     and provide commented, minimal, self-contained, reproducible code.
>
>
>


-- 
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make us
feel like gods.  We are mammals, and have not exhausted the annoying little
problems of being mammals.

                                -K. Mullis

"A big computer, a complex algorithm and a long time does not equal
science."

                              -Robert Gentleman

	[[alternative HTML version deleted]]



More information about the R-help mailing list