I want to run awk from php to do some text processing. I am giving an extremely simple example below:
onecol.awk file
{
print "Hello!";
}
f1.txt
aaa
ccc
eee
f2.txt
ddd
eee
fff
index.php
<?php
$command1 ="awk -f onecol.awk f1.txt > outsingle.txt";
exec($command1);
$command2 ="join <(awk -f onecol.awk f1.txt) <(awk -f onecol.awk f2.txt) > outdouble.txt";
exec($command2);
?>
In this php, first exec command works while the second one does not work. Why is it so?
There should not be any permission problem as the first exec command is creating the outsingle.txt file.
Both the commands work perfectly on console.
Thanks