Reputation: 952
I Get command not found error. 0 and $filestem are the two args and I had the following in a script. And when i execute the script, I get command not found.
echo -e "Enter the file stem name"
read filestem
python gen_par_final.py 0 $filestem
The input files, the python script and the bash script are all in the same folder. the python script works at the command promt as such but not inside the script. Is there any path to be set or something that will resolve the problem?
Upvotes: 3
Views: 24950
Reputation: 2840
This could work
Insert this #! /usr/bin/Python
at the top of gen_par_final.py
file.
(It's usually /usr/bin/python
you need to check out how it's capital P
)
Make gen_par_final.py
executable.
$ chmod +x gen_par_final.py
Edit your shell script.
echo -e "Enter the file stem name"
read filestem
./gen_par_final.py 0 $filestem
Upvotes: 5
Reputation: 2294
could /path/to/python ./gen_par_final.py 0 ${filestem}
solve this?
I assume you checked for spelling errors?
Upvotes: 0