Running Python script from bash: Command not found error
22,796
This could work
Insert this
#! /usr/bin/Python
at the top ofgen_par_final.py
file.
(It's usually/usr/bin/python
you need to check out how it's capitalP
)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
Author by
Vignesh
Updated on July 09, 2022Comments
-
Vignesh over 1 year
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?