From maechler at stat.math.ethz.ch  Fri Nov  5 09:58:48 2004
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Fri Nov  5 09:58:51 2004
Subject: [Rd] Getting the bare R version number {was "2.0.1 buglets"}
In-Reply-To: <418AD6AC.5040701@bankofcanada.ca>
References: <Pine.LNX.4.44.0411042113220.22863-100000@gannet.stats>
	<418AD6AC.5040701@bankofcanada.ca>
Message-ID: <16779.16584.999197.157199@gargle.gargle.HOWL>

>>>>> "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


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