title: List files that are in directory1 but NOT in directory2 and vice versa?
body: <p>Hey, I started bash shell scripting and I'm trying to make a script for an assignment that when you enter two directories, it will check if they exist and display according error message and if both directories DO exist, it will list the differences between the current directories.  </p>
  
  <pre><code>$ cd dir-1
  $ myshellscript . dir-2 (comparing . aka dir-1 against dir-2) 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Files that are in . but not in dir-2
  -rw------- 1 ddddd users   1 2011-03-1 01:26 123123123
  
  Files that are in dir-2 but not in .
  -rw------- 1 ddddd users   1 2011-03-1 01:26 zzzzzzzzzzzz
  </code></pre>
  
  <p>What I have so far that does not seem to detect whether a directory exists nor list differences:  </p>
  
  <pre><code>dir-1=$1
  dir-2=$2
  
  if [ $# &gt; 2  ]
     then
        echo "Usage: compdir dir-name1 dir-name 2"
        exit 1
     elif [ $# &lt; 2 ]
        then
           echo "Usage: comdir dir-name1 dir-name 2"
     elif [ ! -d "$@" ]
        then
           echo "/$@ is not a valid existing directory"
     else
        exit 0
  fi
  
  echo $dir-1
  echo $dir-2
  </code></pre>
  
  <p>List of commands I have to work with, otherwise I would have used <code>comm -32 &lt;(ls -la dir-1)</code> <code>&lt;(ls -la dir-2)</code></p>
  
  <pre><code>http://dl.dropbox.com/u/20930447/index.html
  </code></pre>