[Solved] find the second word in first line which starts with specific word and replace the next line first word in linux


this command will give the required result

awk -F’: *’ -v OFS=”: ” ‘$1==”replace”{r=$2;print;next}r{$1=r;r=””}7’ file

solved find the second word in first line which starts with specific word and replace the next line first word in linux