I am trying to redirect the out of gnu make. Want to redirect ALL to both STDOUT and all.log and error only to error.log.
Below is my program
#!/usr/bin/env python
import optparse
import os
import sys
import commands
command = 'make all > >(tee -a all.log ) 2>&1 2> >(tee -a error.log )'
SysReturnVal=os.system(command)
print "system return value is ", SysReturnVal
When I execute it getting
sh: -c: line 0: syntax error near unexpected token `>'
sh: -c: line 0: `make all > >(tee -a all.log ) 2>&1 2> >(tee -a error.log )'
But executing the same command on linux bash shell executes without error.
make all > >(tee -a all.log ) 2>&1 2> >(tee -a error.log )
Why is this failing when running in python script using os.system, but not in terminal/bash shell ?