math - Ending Parantheses in Awk -


i have following line of code, desire 3 below increase four.

while(i <= 3) 

i have following, it's giving me error closing parentheses:

awk '/ while(i <= /  {sub($3+0,$3+4,$3)} )  1' file >file.tmp && mv file.tmp file 

any thoughts/ideas on how fix error , have increase four?

thank input.

this +4 value:

$ awk '/while\(i <= /  {sub($3+0,$3+4,$3)}  1' file while(i <= 7) 

note matching " while...", leading space, , had ) somewhere after {sub()}. removing them , escaping ( solved issue. graphically:

awk '/ while(i <= /  {sub($3+0,$3+4,$3)} )  1' file       ^     ^                            ^    extra?   escape!                      removed! 

in general, try go simple complicated. basic structure is:

awk '/pattern/ {sub($3+0,$3+4,$3)} 1' file 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -