scripts: fix remove-version-match.sh

This commit is contained in:
Xenhat Hex 2020-04-29 22:42:11 -04:00
parent 7ef61b0bc9
commit 78f0cdbf0d
No known key found for this signature in database
GPG Key ID: 03FE57ED1424AB4D

View File

@ -3,4 +3,6 @@ if [ -z $1 ]; then
echo "Must specify a file to modify..."
exit 1
fi
perl -pe 's;^=?(\S+)(?:-[[:digit:]]+\.\S+)(\s)(\S+)$;\1\2\3;' -i "${1}"
regex='^=?(\S+)(?:-[[:digit:]]+\S*)(\s)(\S+)$'
sub='\1\2\3'
perl -pe "s;$regex;$sub;gm" -i "${1}"