I have a inputfile with template as shown below. I want to change the Version: using sed.
Package: somename
Priority: extra
Section: checkinstall
Maintainer: joe@example.com
Architecture: i386
Version: 3.1.0.2-1
Depends:
Provides: somename
Description: some description
Currently I am getting the current version using grep -m 1 Version inputfile | sed 's/[:_#a-zA-Z\s"]*//g'
and I am trying to replace the current version with sed 's/3.1.0.2-1/3.1.0.2/' inputfile
However this does not seem to work, but when I try it in command line using echo it works.
echo 'Version: 3.0.9.1' | sed 's/3.0.9.1/3.2.9.2/'
Output: Version: 3.2.9.2
Any help on how I can accomplish this would be appreciated. Preferably I would like to change the version without getting the current version in the file.
Thanks In Advance