title: Write script in linux to display image on webpage
body: <p>So i'm trying to write a script to print out an image on a webpage. I was able to print out header tags like h1 but I could not get image tags to work. Assume my file structure is:</p>
  
  <pre><code> usr
    - lib
      - cgi-bin
        - test.sh
        - images
         - a.jpg
         - b.jpg
  </code></pre>
  
  <p>I made a script file named test.sh and a folder of images named images and allowed them to be executable. Here is the file test.sh that has the code the I call from my browser by typing <a href="http://127.0.0.1/cgi-bin/test.sh" rel="nofollow">http://127.0.0.1/cgi-bin/test.sh</a> in my browser</p>
  
  <pre><code>#!/bin/bash
  echo "Content-type: text/html"
  echo 
  echo &lt;h1&gt;Test&lt;/h1&gt;
  echo &lt;img src=images/a.jpg&gt;
  </code></pre>
  
  <p>The web server i'm using is Apache2</p>