I am trying to run my program from Qt Creator with command line options involving process substitution. Here's the command (I want each line written to file to be prepended with the time and date, achieved by predate.sh, while the output to the terminal remains unchanged):
$ exec | tee >(predate.sh > output.txt)
/bin/sh: -c: line 0: syntax error near unexpected token `('
Process substitution is a feature of
bash, whereas QtCreator is apparently hardcoded to use
sh to execute the run command. You can inject
bash into your command as follows:
$ exec | bash -c 'tee >(predate.sh > output.txt)'