I have a file (a.txt) with the following content:Redhat master 12345678 V1A 20.0/20.0.1Windows slave 12345678 V1B 19.0/19.0.1I want to grep line with the word master and replace the 4th and fifth field with a new value.For example, a new a.txt might be:Redhat master 12345678 V1B 20.0/20.0.2Windows slave 12345678 V1B 19.0/19.0.1Here V1A is replaced with V1B and 20.0/20.0.1 with 20.0/20.0.2Can someone help to achieve this?I also want to pass new values as script parameter:Can I pass new values as a parameter to a script? I was trying below script:The contents of script (test.sh) is as follows:#!/bin/bashif [ $2 ==  ]; then    echo usage: $0 \<version\> \<revision\>    exit -1else   version=$1   revision=$2fiawk '/master/{$4=$1;$5=$2}' a.txt >newa.txtWhen I run:#bash test.sh V1B 20.0/20.0.2it doesn't work.
Replace fields in file inline
text processing;awk;grep