title: unix shell scripting- Using mv command in if condition
body: <p>I want to move a file to a folder based on its file extension. 
  example: if the file is .csv,it should move to COMPLETED folder , if the file has any extension other any .csv then it should move to REGULAR folder.</p>
  
  <p>Below is my shell script and its not working. Can you let me know what is the problem with it?</p>
  
  <pre><code>#!/bin/bash
  cd /apps/int/apd/$1/work
  
  if ls /apps/int/apd/$1/work/*.csv &amp;&gt; /dev/null; then
      mv *.csv /apps/int/apd/$1/COMPLETED
  else
      /apps/int/apd/$1/Regular
  fi
  </code></pre>