Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: =?windows-1252?Q?=93Stardate=94_Version_Numbering?= Date: Tue, 07 Jun 2011 18:52:51 +0200 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 7 Jun 2011 16:52:50 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="5KCZtY1lR3qFupI+iOINXQ"; logging-data="21409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GjGA5LqqZkcDcFRga6ZcM" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:OvPsnxOarDNbajVu3wC08Ac2Hpo= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5071 On 07/06/2011 13:59, Lawrence D'Oliveiro allegedly wrote: > 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... That's so awesome! I wanna have sex with you right now.