title: Write a shell script to calculate the number of employees
body: <p>I need to find the count of employees whose salary is less than average salary of all employees.</p>
  
  <p>The file with the employee details will be given as a command line argument when your script will run
  example-></p>
  
  <p>Input: File:</p>
  
  <pre><code>empid;empname;salary
  100;A;30000
  102;B;45000
  103;C;15000
  104;D;40000
  </code></pre>
  
  <p>Output:
  2</p>
  
  <p>my solution-></p>
  
  <pre><code>f=`awk -v s=0 'BEGIN{FS=":"}{if(NR&gt;1){s+=$3;row++}}END{print s/row}' $file`;
  
  awk -v a="$f" 'BEGIN{FS=":"}{if(NR!=1 &amp;&amp; $3&lt;a)c++}END{print c}' $file;
  </code></pre>
  
  <p>This is what i have tried so far
  but output comes out to be
  0</p>