title: execl() in child process doesn't end
body: <p>I wrote a simple program to understand the concept of execl(). Here is my program</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;unistd.h&gt;
  
  int main()
  {
      pid_t pid;
      pid = fork();
      if(pid == 0)
      {
          execl("/bin/sh","sh","-c","ls -l *.c", NULL);
      }
  }
  </code></pre>
  
  <p>When I execute it, it displays the list of files that have extension ".c". But, it seems that the child process doesn't end and the cursor keeps blinking.</p>
  
  <pre><code>srico@ubuntu:~/Desktop/c$ -rw-rw-r-- 1 srico srico   84 Jun 30 08:30 cmdacc.c
  -rw-rw-r-- 1 srico srico  138 Jul  4 11:08 execfun.c
  -rw-rw-r-- 1 srico srico  343 Jul  4 10:27 execvp1.c
  -rw-rw-r-- 1 srico srico  167 Jun 23 08:20 filechar.c
  -rw-rw-r-- 1 srico srico  195 Jun 23 11:20 fileline.c
  -rw-rw-r-- 1 srico srico  203 Jun 27 07:17 filestat.c
  -rw-rw-r-- 1 srico srico  112 Jun 22 11:11 new.c
  -rw-rw-r-- 1 srico srico  304 Jun 27 12:09 parchild1.c
  -rw-rw-r-- 1 srico srico 1038 Jun 27 10:56 parchld.c
  </code></pre>
  
  <p>I have to manually kill the process using ctrl+c.</p>
  
  <pre><code>^C
  srico@ubuntu:~/Desktop/c$
  </code></pre>
  
  <p>please help me correct the mistake.</p>