[Rd] Getting the bare R version number {was "2.0.1 buglets"}

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Fri 05 Nov 2004 - 19:58:48 EST

>>>>> "PaulG" == Paul Gilbert <pgilbert@bank-banque-canada.ca> >>>>> on Thu, 04 Nov 2004 20:26:04 -0500 writes:

>> If you want the R version, that is 'R --version'.
>>
>>

    PaulG> I've been using this, but to make it into a file name
    PaulG> I need to do some stripping out of the extra
    PaulG> stuff. (And tail and head on Solaris do not use -n
    PaulG> whereas Linux wants this, so it becomes difficult to
    PaulG> be portable.) Is there a way to get just "R-2.0.1"
    PaulG> from R or R CMD something?

yes, by applying Brian's advice and good ol' "sed" :

  R --version | sed -n '1s/ /-/; 1s/ .*//p'

Martin



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Nov 05 20:11:37 2004

This archive was generated by hypermail 2.1.8 : Fri 05 Nov 2004 - 21:08:36 EST