I'm taking in a bunch of scripts, and creating a wrapper for them in python. I didn't create the scripts that were given to me. Currently I'm working with python 2.2, and the shell I'm using is a csh shell.
When I run the script in the following manner:
>> setenv some_var '/some/path/'
>> <some more setenv>
>> ./script -flag >& log.txt < /dev/null &
It run's perfectly fine.
The issue arises when I use a bash wrapper to call my python wrapper. My bash script (analysis.sh) is as follows:
#!/bin/bash
#environment variables
ENV1='/path/for/env1'
ENV2='/path/for/env2'
export ENV1
export ENV2
./run_analysis.py $@
exit
In my python file, all I'm basically doing is performing
....
os.system(script_path + script_name + script_flag)
....
Whenever I run the script in the following manner on csh shell:
./analysis.sh -flag script_name >& log.txt < /dev/null &
The script all of a sudden gives me a bunch of broken pipe errors ("grep: writing output: Broken pipe"). I know that the script does use a lot of grep. I just don't understand why these errors would pop up when I perform redirection. In python 2.2, only 'os' and 'commands' module exist. I'm forced to use these constraints.
Thank you.