diff options
author | Jan Macku <jamacku@redhat.com> | 2019-06-11 13:09:34 +0200 |
---|---|---|
committer | Lukáš Nykrýn <lnykryn@redhat.com> | 2019-07-31 14:08:46 +0200 |
commit | bfda3cc2acdea827909e6c89bda5bbb5140cda6c (patch) | |
tree | d28084440053bea0433eb612534df0ea864524a7 | |
parent | 7a763e8f87764d5d3d35269ae4b05c02974f5e55 (diff) | |
download | initscripts-bfda3cc2acdea827909e6c89bda5bbb5140cda6c.tar initscripts-bfda3cc2acdea827909e6c89bda5bbb5140cda6c.tar.gz initscripts-bfda3cc2acdea827909e6c89bda5bbb5140cda6c.tar.bz2 initscripts-bfda3cc2acdea827909e6c89bda5bbb5140cda6c.tar.xz initscripts-bfda3cc2acdea827909e6c89bda5bbb5140cda6c.zip |
Replace not working awk command with sed
Sed command get version number from spec file and increment last
number by one. Work like old awk command was intended to work.
Source: https://stackoverflow.com/questions/14348432/how-to-find-replace-and-increment-a-matched-number-with-sed-awk/14348899
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -32,7 +32,7 @@ localstatedir = /var sharedstatedir = $(localstatedir)/lib VERSION := $(shell gawk '/Version:/ { print $$2 }' initscripts.spec) -NEXT_VERSION := $(shell gawk '/Version:/ { print $$2 + 0.01}' initscripts.spec) +NEXT_VERSION := $(shell sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)\.([0-9]*)/echo "\1\.\2\.$$((\3+1))"/gep' initscripts.spec) all: make-binaries make-translations |