slumbering
10/4/2016 - 1:52 PM

Script bash - Change value in .yml file

#!/bin/bash
IFS='%' #/ Keep white space
YMLPARAM='version_css_main:'
CURENTCSSVERSION=$(awk -F ":" '/version_css_main/{print $2}' /c/dev/php/project/euronews-front-v2/application/app/config/config.yml)
NEWVERSION="  $(($CURENTCSSVERSION+1))"
sed -i -e "s/$YMLPARAM$CURENTCSSVERSION/$YMLPARAM$NEWVERSION/g" /c/dev/php/project/euronews-front-v2/application/app/config/config.yml