4

I'm getting nuts with this...

I want to be able to open the application "Jupyter Notebook" with a one line .sh script (that I have made executable) that simply says:

jupyter notebook

If I put this line directly in Terminal, it works. If I drag and drop the .sh script to Terminal, and hit enter, it works. But if I run the script from Nautilus and say "Run in Terminal" you see Terminal opening for the fraction of a second, and then nothing happens.

Help is much appreciated. Best, Khalo

//edit

I added "/bin/bash" to the end of the script, and now Terminal stays open, and I am able to see the error message that says:

"/path_to_script/script.sh: 1: /path_to_script/script.sh: jupyter: not found"

Isn't this weird? As I said before, if typed directly into Terminal it works!

1 Answers1

3

Use this instead:

#!/bin/bash
/home/$USER/.local/bin/jupyter notebook

or

#!/bin/bash
/usr/local/bin/jupyter notebook

If that still doesn't work, replace the path to jupyter with the output of the following command:

which jupyter
mchid
  • 42,315
  • 7
  • 94
  • 147