title: AWK if field one is equal to vaiable value then update field two and three
body: <p>I am working on a shell script to process a CSV file. I have a csv file as shown below.</p>
  
  <pre><code>cat list.csv
  0003812,3,2
  0000808,0,0
  0003346,1,0
  0018003,8,1
  0044477,3,0
  0197183,0,0
  </code></pre>
  
  <p>In the script i come upto logic where i get value of first field from this file in a varible "var". I need to increment field two and three if the value of vaiable "var" matches field 1. I need to make sure that the changed values are put back in the same field in the same file.</p>
  
  <p>I tried something like below but it doesnot work</p>
  
  <pre><code>awk -F, '$1=="$var" {$2+=1;$3+=1}1' OFS=, /foo/bar.csv
  </code></pre>
  
  <p>Below is expected output if var="0044477"</p>
  
  <pre><code>Output
  0003812,3,2
  0000808,0,0
  0003346,1,0
  0018003,8,1
  0044477,4,1
  0197183,0,0
  </code></pre>