How to execute install.sh under Big Sur?

Solution 1:

.sh files are what is known as "shell scripts". Basically, when you run a .sh file, you're not executing that file directly - instead the contents of the file is given to a specific program as instructions to follow. That specific program is named in the first line of the .sh file prefixed by #!.

The error message you see means that the program specified by that first line of the file does not exist (at the given location). Essentially the shell script is incorrectly made.

If you have knowledge about the purpose of the script, and how your system is setup, you might be able to use a texteditor to change the file line of the file to point to the correct program - otherwise I would contact the supplier of the program and ask for updated files and instructions.

UPDATE: You have updated your question with the first part of the contents of the shell script. This makes it clear that the problem is that the first line of the script ends not with a normal newline symbol (LF), but rather a Windows-style newline consisting of two symbols (CR LF).

You can fix the line feeds in the file by running this command in the same folder as the shell script using the Terminal:

perl -pi -e 's/\r\n|\n|\r/\n/g' install.sh