title: Using execlp system call with shell metacharacters in the arguments in C
body: <p>Program : List all C files in the current folder using <code>execlp()</code> system call:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  int main()
  {
      printf("Before Execl\n");
      execlp("ls","ls","*.c",NULL); // this should print all c files in the current folder.
      return 0;
  }
  </code></pre>
  
  <p>Program output:</p>
  
  <pre><code>Before Execl
  ls: cannot access *.c: No such file or directory
  </code></pre>
  
  <p>Whenever I use '<code>*</code>' in the search pattern, I am getting a similar kind of error. Please suggest some appropriate solution.</p>