Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #5078
| 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 <avl@gamma.logic.tuwien.ac.at> |
| Subject | Re: “Stardate” Version Numbering |
| References | <isl3rm$o72$1@lust.ihug.co.nz> <4dee15eb$0$49174$e4fe514c@news.xs4all.nl> <ism9of$egf$1@lust.ihug.co.nz> |
| 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 | <slrniutcrl.phi.avl@gamma.logic.tuwien.ac.at> (permalink) |
| 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 |
Show key headers only | View raw
Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> 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<<<scale=1\;`date +%s`/86400)\"/ AndroidManifest.xml Btw., it won't be compatible with older shells (e.g. ksh), though, for the "<<<".
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
“Stardate” Version Numbering Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-07 11:59 +0000
Re: “Stardate” Version Numbering Silvio <silvio@moc.com> - 2011-06-07 14:13 +0200
Re: “Stardate” Version Numbering bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-06-07 13:51 +0100
Re: “Stardate” Version Numbering Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-06-07 18:15 -0300
Re: “Stardate” Version Numbering Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-08 10:46 +1200
Re: “Stardate” Version Numbering Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-06-07 23:25 +0000
Re: “Stardate” Version Numbering Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-06-07 18:52 +0200
csiph-web