7 Feb
2003
7 Feb
'03
8:16 p.m.
Hi.
echo 1.1 | sed -e 's/^\([0-9]+\)\.\([0-9]+\).*/\1\2/'
After some hints from the local Unix gurus I now know why this breaks: sed uses BREs (basic regular expressions, see man 7 regex) which simply do not know the + operator. awk uses ERE (extended RE), and the most powerful are the PRE (Perl RE). On the other hand: Note that version numbers which have two digits subversion will break comparison ;) 1.10 --> 110 > 21 = 2.1 :) -- ==> Ciao, Mosu (Moritz Bunkus)