Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.nobody.at!texta.sil.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: =?UTF-8?Q?=E2=80=9CStardate=E2=80=9D?= Version Numbering References: <4dee15eb$0$49174$e4fe514c@news.xs4all.nl> Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: Date: 07 Jun 2011 23:25:41 GMT Lines: 18 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1307489141 tunews.univie.ac.at 60386 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5078 Lawrence D'Oliveiro wrote: > In message <4dee15eb$0$49174$e4fe514c@news.xs4all.nl>, Silvio wrote: >> What about date +%s%N > Close. Try this version: doesn’t need Julian, and also shorter: > sed -i -r 's/(android:versionName=\")[^\"]*(\")/\1'"$(bc <<<"scale = 1; ($(date +%s)) / 86400")"'\2/' AndroidManifest.xml I don't quite see the reason why you would actually capture the closing double-quote char... and double-quotes aren't special to "sed -r", so they need no backslash before them. Then the last lingle-quoted part can be included into the double-quoted middle part, re-introducing one \", but making it again shorter. Also, removing some redundant spaces, quotes and parens from around bc, and replacing one of the $(...) with backticks shortens it again. sed -i -r 's/(android:versionName=")[^"]*"/\1'$(bc<<