title: Syntax Error in shell_exec but not in terminal
body: <p>I am trying to run a php script and do a loop. This is the code I use in terminal and it works:</p>
  
  <p><code>for i in {1..60}; do printf "file '%s'\n" video.mp4 &gt;&gt;list.txt; done</code></p>
  
  <p>However, if I try to call it in my php script as <code>shell_exec()</code>:</p>
  
  <p><code>shell_exec('for i in {1..60}; do printf "file '%s'\n" video.mp4 &gt;&gt;list.txt; done');</code></p>
  
  <p>I get error:</p>
  
  <blockquote>
    <p>PHP Parse error:  syntax error, unexpected ''\n" video.mp4 >>list.txt; don' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in /home/vagrant/Code/play/index.php on line 58</p>
    
    <p>Parse error: syntax error, unexpected ''\n" video.mp4 >>list.txt; don' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in /home/vagrant/Code/play/index.php on line 58</p>
  </blockquote>