0

I am new to Linux environment and scripts but i'm trying to simply create a .sh file that launches a software when executed in my Oracle VM's terminal. However, it returns an error which origin I don't know... Can anyone help me correcting it ?

My script is only 2 lines :

export PATH="$PATH:/lib/python3.8"
python3 NOSTRADAMUS.py     # it's the software I want to execute through the .sh file

But it only returns :

': [Errno 2] No such file or directorypy

The NOSTRADAMUS.py file works well : when I launch it directly with a python3 NOSTRADAMUS.py in the console, it does launch it so the problem really comes from the .sh file. I tried writing the full path to NOSTRADAMUS.py but the result is more or less the same.

Can anyone help me ? Thx !!

Lalastro
  • 61
  • 8
  • It separately seems unlikely that you have a directory called `/lib/python3.8` or, if you have one, that it contains executable binaries unless you have cobbled together a fairly unusual installation yourself. – tripleee Sep 16 '21 at 14:03
  • Run your script like this to get debugging output and have bash be more strict: `bash -eux run.sh` – Robert Sep 16 '21 at 14:04
  • I strongly suspect that you've saved this script with Windows line endings (CR-LF) rather than Unix (LF only). See that extra `py` at the end of the error message? That's probably from the first line of the full error, which got partially overwritten due to a CR being present in the message. – jasonharper Sep 16 '21 at 14:14
  • Thank you @jasonharper for your answer, indeed actually the software was to be used on a PC equipped with windows. The .sh script was thus originally a .bat file that I translated to UNIX langage (my goal is to run the software on linux embedded onboard a satellite). I didn't think there could be leftover caracters from the .bat file. I re-wrote the .sh file as a new file to avoid leftovers from windows. It seems to have removed the previous error but I still get one. This time it says `python3: can't open file 'NOSTRADAMUS.py' : [Errno 2] No such file or directory`. what should I do ? – Lalastro Sep 16 '21 at 14:36
  • Is the filename actually capitalized like that? (Unix filesystems are case-sensitive, unlike Windows.) If it's not that, you may need to give the full path to the file. – jasonharper Sep 16 '21 at 14:41
  • @jasonharper thx. it is indeed capitalized. I wrote the entire path and t seems to work now ! thank you very much ! :) – Lalastro Sep 16 '21 at 15:18

0 Answers0