.sh File Not Found

You probably have set the wrong shabang. In ubuntu bash is normally located in /bin/bash so at the top of the file you should have:

#!/bin/bash

instead of:

#!/usr/bin/bash

Another way to run the script is to just tell bash (or sh) to execute it:

bash ./test.sh

In my case, I did sh file.sh, which was definately there, but in the file I had cp /other/file.sh and the other file was missing. Yet the error message only said sh file.sh: Not found.


I solved the problem by changing the end of the line from CRLF to LF since my script was edited in windows.

Tags:

Shell

Ubuntu

Sh