title: execlp multiple "programs"
body: <p>I want to run something like</p>
  
  <pre><code>cat file.tar | base64 | myprogram -c "| base64 -d | tar -zvt "
  </code></pre>
  
  <p>I use <code>execlp</code> to run the process.</p>
  
  <p>When i try to run something like <code>cat</code> it works, but if i  try to run  <code>base64 -d | tar -zvt</code> it doesn't work.</p>
  
  <p>I looked at the bash commands and I found out that I can run bash and tell him to run other programs. So it's something like:</p>
  
  <pre><code>execlp ("bash", "-c", "base64 -d | tar -zvt", NULL);
  </code></pre>
  
  <p>If I run it on the terminal, it works well, but using the <code>execlp</code> it dont work.
  If I use <code>execlp("cat", "cat", NULL)</code> it works.</p>
  
  <p>Someone knows how to use the <code>-c</code> param on execlp to execute multiple "programs"?
  I cant use system because i use pipe and fork.</p>
  
  <p>Now i noticed, if i try to use execlp("bash", "bash", "-c", "base64", NULL)... nothing happens.
  If i use execlp("cat", NULL) it's ok..
  I'm writing to the stdin... i don't know if its the problem with the bash -c base64.. because if i run on the terminal echo "asd" | bash -c "cat"
  it goes well</p>