title: Loop over files in directory using shell script Ubuntu
body: <p>I am trying to execute my python file using a shell script, in Ubuntu 12.04. For doing this, I have the following code, with the help of the <a href="http://www.cyberciti.biz/faq/bash-loop-over-file/" rel="nofollow">link</a> </p>
  
  <pre><code>     #!/bin/bash
  
       file_path=/home/itachi/LN_project/cover_image
  
       for f in $file_path
       do
            python Question2_lsbreplacement_encode.py $f message_2.txt 0.7
       done
  </code></pre>
  
  <p>I am new to scripting, so please bear with me if there are other mistakes as well. Am welcome to inputs. This is the following error I get</p>
  
  <pre><code>     Traceback (most recent call last):
       File "Question2_lsbreplacement_encode.py", line 26, in &lt;module&gt;
       img = Image.open(imgname) # reading image
       File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1955, in open
       fp = __builtin__.open(fp, "rb")
       IOError: [Errno 21] Is a directory: '/home/itachi/LN_project/cover_image'
  </code></pre>
  
  <p>Basically, I do not want to explicitly mention the path as well. I want to concatenate just the folder name with the current working directory. Can you please tell me how I can do this?</p>