title: Modify a shell variable inside awk block of code
body: <p>Is there any way to modify a shell variable inside awk block of code?</p>
  
  <pre><code>--------- [shell_awk.sh]---------------------
   #!/bin/bash
  
  shell_variable_1=&lt;value A&gt;
  shell_variable_2=&lt;value B&gt;
  shell_variable_3=&lt;value C&gt;
  
  awk 'function A(X)
  { return X+1 }
  { a=A('$shell_variable_1')
    b=A('$shell_variable_2')
    c=A('$shell_variable_3')
    shell_variable_1=a
    shell_variable_2=b
    shell_variable_3=c
  }' FILE.TXT
  --------- [shell_awk.sh]---------------------
  </code></pre>
  
  <p>This is a very simple example, the real script load a file and make some changes using functions, I need to keep each value before change into a specific variable, so then I can register into MySQL the before and after value.</p>
  
  <p>The after value is received from parameters ($1, $2 and so on).</p>
  
  <p>The value before I already know how to get it from the file.</p>
  
  <p>All is done well, except the shell_variable been set by awk variable. Outside from awk block code is easy to set, but inside, is it possible?</p>