When I modified the spec configuration file packaged by rpm today, I encountered a problem:You need to set around 100Source codeThe version number in the release row in the spec configuration file is replaced with the macro variable % {_ release }..
If you want to manually modify it, you need to modify it more than 100 times, but using the SED and grep commands is simple:
Sed-I "s/release: 1/release: % {_ release}/g" 'grep release: 1-rl -- include = "*. spec "./'
The above command is to be verified. I have written it for the time being. I will confirm it tomorrow and try again.
A simple method to replace strings in multiple files in batches in Linux.
You can use the SED command to replace strings in multiple files in batches.
Sed-I "s/original string/New String/g" 'grep original string-rl directory'
For example, if you want to replace mahuinan with huinanma, run the following command: sed-I "s/mahuinan/huinanma/g" 'grep mahuinan-RL/WWW'
This is the simplest string replacement command in Linux!
The specific format is as follows:
Sed-I "s/oldstring/newstring/g" 'grep oldstring-RL/Path'
InstanceCode: Sed-I "s/size/Sun/month/g" 'grep size-RL/usr/'
Sed-I "s/size/Sun/month/g" 'grep size-rl ./'
Refer to the two articlesArticle:
1. Replacing strings in multiple files in Linux in batches
Replacing strings in multiple files in Linux in batches
2. Linux Shell replaces strings in multiple files in batches
Linux Shell replaces strings in multiple files in batches
3. Sed and awk learning notes
Sed and awk learning notes