On Wednesday 10 May 2006 4:02 pm, Ginger Cheng wrote: > Hello, PHP gurus, > I have a command that I want to run using system function. The > command exploits temporary named pipes in the place of temporary files. > > my command is > > paste <(cut -f1 file1) <(cut -f2 file2) > final_file > > It works perfectly well if I just type it in my interactive > shell. But if I do a > > <?php > $cmd = " paste <(cut -f1 file1) <(cut -f2 file2) > final_file"; > system($cmd); > ?> > > I got the syntax error msg as > "sh: -c: line 1: syntax error near unexpected token `('". I have tried > to 'escapeshellcmd' the command and run it in system, then I got > > paste: invalid option -- f > Try `paste --help' for more information. > > Also tried exec. I really want to take advantage of the > temporary named pipes so I don't have to worry about the temporary files > generated. I've been googling around without much help. Could anyone > plz give me some hint? Thanks a lot > ginger Think you might want the shell_exec() command instead. http://us2.php.net/manual/en/function.shell-exec.php HTH -- Joe Henry www.celebrityaccess.com jhenry@xxxxxxxxxxxxxxxxxxx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php