userInThisWorld
userInThisWorld

Reputation: 1391

/bin/bash: command not found Google Colab

I am trying to run a ready project on Google Colab.. when I run a shell it gives the following error:

/bin/bash: example.sh: command not found

How I can solve this problem?

Upvotes: 3

Views: 18367

Answers (2)

Hiya Ben-Hamu
Hiya Ben-Hamu

Reputation: 1

This problem happened to me too, After I ran the installs again the problem went away. It turns out that every time you enter the notebook you have to do all the installations again...

Upvotes: 0

Amir
Amir

Reputation: 16607

You have two options to run shell script in google-colab:

1) Execute a single script with !:

!sh example.sh
!echo "I am your code !!!" 

2) Execute entire code-block as shell script with %%shell:

%%shell
sh example.sh
echo "You should add %% "

Note: In the second approach, entire block interpreted as shell script. You do not need ! at beginning of every script.

Upvotes: 8

Related Questions