intern=TRUE seems not working in system command in Mac OS
1
0
Entering edit mode
@raffaele-calogero-294
Last seen 9.0 years ago
Italy/Turin/University of Torino
Hi, I am trying to save the output produced from the following command in Mac : > tmp.java <- system("java -version", intern=TRUE) java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) > tmp.java character(0) The intern command work perfectly under windows and linux . Is there any other option to get manage to save the output of system command in a variable? Cheers Raffaele > sessionInfo() R version 2.14.1 (2011-12-22) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base > -- ---------------------------------------- Prof. Raffaele A. Calogero Bioinformatics and Genomics Unit MBC Centro di Biotecnologie Molecolari Via Nizza 52, Torino 10126 tel. ++39 0116706457 Fax ++39 0112366457 Mobile ++39 3333827080 email: raffaele.calogero at unito.it raffaele[dot]calogero[at]gmail[dot]com www: http://www.bioinformatica.unito.it
• 1.2k views
ADD COMMENT
0
Entering edit mode
@harris-a-jaffee-3972
Last seen 10.1 years ago
United States
As far as I know, 'intern=TRUE' only captures standard output, and not standard error unless you do something explicitly to put that on standard output. In this case, they won't be distinguishable, but at least you can see both. # here I get the same thing you do > x = system("java -version", intern=TRUE) java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) Client VM (build 20.4-b02-402, mixed mode) # put stderr on stdout > x = system("java -version 2>&1", intern=TRUE) > x [1] "java version \"1.6.0_29\"" [2] "Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)" [3] "Java HotSpot(TM) Client VM (build 20.4-b02-402, mixed mode)" On Jan 30, 2012, at 5:17 AM, rcaloger wrote: > Hi, > I am trying to save the output produced from the following command in Mac : > > > tmp.java <- system("java -version", intern=TRUE) > java version "1.6.0_29" > Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527) > Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) > > tmp.java > character(0) > > The intern command work perfectly under windows and linux . > Is there any other option to get manage to save the output of system command in a variable? > > Cheers > Raffaele > > > sessionInfo() > R version 2.14.1 (2011-12-22) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > locale: > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > > > > -- > > ---------------------------------------- > Prof. Raffaele A. Calogero > Bioinformatics and Genomics Unit > MBC Centro di Biotecnologie Molecolari > Via Nizza 52, Torino 10126 > tel. ++39 0116706457 > Fax ++39 0112366457 > Mobile ++39 3333827080 > email: raffaele.calogero at unito.it > raffaele[dot]calogero[at]gmail[dot]com > www: http://www.bioinformatica.unito.it > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT

Login before adding your answer.

Traffic: 556 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6