Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Tue, 07 Jun 2011 07:51:16 -0500 Date: Tue, 07 Jun 2011 13:51:16 +0100 From: bugbear User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.19) Gecko/20110429 Fedora/2.0.14-1.fc13 SeaMonkey/2.0.14 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: =?UTF-8?B?4oCcU3RhcmRhdGXigJ0gVmVyc2lvbiBOdW1iZXJpbmc=?= References: <4dee15eb$0$49174$e4fe514c@news.xs4all.nl> In-Reply-To: <4dee15eb$0$49174$e4fe514c@news.xs4all.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 22 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-XGUfmFtislxVvx5hEkgXtBCMVYWdmg7UKcDf4maXPeFSsGNXswg6q/DhBstqkhGDlufSEEyWn6oOHDw!IIW5moJP0PFGGMKw/IBhesqeWWWKZO40cyiwuNAYYk0W3Eiruk1hXh/eeT4BP2/JlMod4fDPmskM!HPdHHjjbwu45UmIsYLgRLNPWbw== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2058 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5066 Silvio wrote: > On 06/07/2011 01:59 PM, Lawrence D'Oliveiro 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... > > What about date +%s%N I am reminded of this: http://www.infiltec.com/j-h-wrld.htm BugBear