Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.java.programmer Subject: “Stardate” Version Numbering Date: Tue, 7 Jun 2011 11:59:50 +0000 (UTC) Organization: Geek Central Lines: 11 Message-ID: NNTP-Posting-Host: 118-92-86-36.dsl.dyn.ihug.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: lust.ihug.co.nz 1307447990 24802 118.92.86.36 (7 Jun 2011 11:59:50 GMT) X-Complaints-To: abuse@ihug.co.nz NNTP-Posting-Date: Tue, 7 Jun 2011 11:59:50 +0000 (UTC) User-Agent: Emacs 23 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5064 The following one-liner sets the versionName attribute in AndroidManifest.xml to a number based on the number of days (accurate to 0.1 day) since the *nix epoch. This is what I’ve been using for a version number in one or two projects, in lieu of anything that makes more sense. :) sed -i -r 's/(android:versionName=\")[^\"]*(\")/\1'"$(bc <<<"scale = 1; ($(Julian -f) - $(Julian -d 1970 1 1)) / 1")"'\2/' AndroidManifest.xml This needs my “Julian” script, available here . Though it can probably be rewritten to do without it, using the GNU “date” command instead...