title: directory path as command line argument in bash
body: <p>The following bash script finds a <code>.txt</code> file from the given directory path, then changes one word (change mountain to sea) from the <code>.txt</code> file</p>
  
  <pre><code>#!/bin/bash
  FILE=`find /home/abc/Documents/2011.11.* -type f -name "abc.txt"`
  sed -e 's/mountain/sea/g' $FILE 
  </code></pre>
  
  <p>The output I am getting is ok in this case.
  My problem is if I want to give the directory path as command line argument then it is not working. Suppose, I modify my bash script to:</p>
  
  <pre><code>#!/bin/bash
  FILE=`find $1 -type f -name "abc.txt"`
  sed -e 's/mountain/sea/g' $FILE 
  </code></pre>
  
  <p>and invoke it like:</p>
  
  <pre><code>./test.sh /home/abc/Documents/2011.11.*
  </code></pre>
  
  <p>Error is:</p>
  
  <pre><code>./test.sh: line 2: /home/abc/Documents/2011.11.10/abc.txt: Permission denied
  </code></pre>
  
  <p>Can anybody suggest how to access directory path as command line argument?</p>