I can use the following bash script to run separate output terminals at the same time:
for i in 0 1 2 3; do urxvt -name Terminal$i&; done
But if I try to run this bash script with a PHP script, if the failure occurred with an error:
sh: -c: line 0: syntax error near unexpected token `;' sh: -c: line 0: `for i in 0 1 2 3; do urxvt -name Terminal$i&; done'
PHP script:
<?php system('for i in 0 1 2 3; do urxvt -name Terminal$i&; done'); ?>
This also fails:
<?php exec('for i in 0 1 2 3; do urxvt -name Terminal$i&; done'); ?>
There are no errors without '&', but I want to start everything in the background. Leaving '&' results in an invalid urxvt argument error.
Any ideas?
source share