> From: David Marchand [mailto:david.marchand at 6wind.com] > Sent: Tuesday, February 24, 2015 10:44 AM > To: Mcnamara, John > Cc: Panu Matilainen; dev at dpdk.org; Olivier Matz > Subject: Re: [dpdk-dev] [PATCH v2] mk: Rework gcc version detection to permit > versions newer than 4.x > >> Or something like this in Sed or Perl within the $(shell) expansion: > > Well, we have no dependency on perl so far. > I would prefer we keep at just makefile and shell stuff. > > Olivier ? opinion ?
Hi, A similar anchored regex would work in sed: $ echo 4.7 | sed -r 's/^[0-9]+\.[0-9]$/&.0/' 4.7.0 $ echo 4.7.2 | sed -r 's/^[0-9]+\.[0-9]$/&.0/' 4.7.2 $ echo 144.7.2 | sed -r 's/^[0-9]+\.[0-9]$/&.0/' 144.7.2 John --