I am running a bash script from Python. My IDE is Eclipse with PyDev. I have installed a software that has a bash command bull2flux that I want to run inside my bash script. bull2flux is usually run like this:
bull2flux someFile > outFile
The problem is that this works fine when it is invoked directly in the terminal, but not when running it from my python script. I get the error bull2flux: command not found. I have tried running the compiled version of my software from the terminal, but the same error occurs. Is this a problem with Eclipse? Do I have to source the command somehow? bull2flux is sourced in my .bashrc file like this:
source path/to/software/bin/init.sh /dev/null
Additional info: This is how I run it in my bash script:
for file in ${folder_bml_files}/*
do
#Other stuff here
bulledFile="bulltmp"
bull2flux ${file} > ${bulledFile}
#Other stuff here
done
I assume that the bull2flux executable is not in the PATH while your script is being executed. Try either using its full path or updating the PATH variable before calling the script.
EDIT: If bull2flux is just a shell function (not an executable), you might have to source the defining shell script from your script. Try adding the line
source path/to/software/bin/init.sh /dev/nullfrom your .bashrc to your own shell script.