On Tuesday, 5 December 2017 10.15.33 CET Sudip Dutta wrote: > Anyway, Since "I only run it in one machine for now" and need to deploy as > quickly as I can , I am planning to do this (in a rather crude way :-)) by > using a simple bash script and invoking it in remote target - > > oldnum=`cat filename | sed -n '8'p | cut -d '=' -f2` > newnum=`expr $oldnum + 1` > sed -i "s/$oldnum\$/$newnum/g" filename
If BUILD_VERSION = 4 is the only content of that file you could use this oneliner gawk -i inplace '{ print $1,$2,++$3}' filename in the Ansible command module -- Kai Stian Olstad -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3576684.kgB3fyJI9I%40x1. For more options, visit https://groups.google.com/d/optout.