system('sh', '-c', 'foo > file');
or the equialent
system('foo > file');
The latter is also suitable for Windows.
In reply to Re: System call doesn't recognise '>'
by ikegami
in thread System call doesn't recognise '>'
by Lauras
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |