What is happening is that you do not have permission to execute your start.sh
file. What you have to do is either give execution permission to file like so, if you are the owner of the file.
chmod u+x start.sh
or run it using sh
or bash
command
sh start.sh
or
bash start.sh
will execute it, no need for execution permission.
NOTE: Read somewhere that later is needed in Mac OS in some cases. Correct me if I am wrong.
EDIT:
Per @GordonDavisson comment. In your case, with simple script, it does not matter if you use Bourne shell or BASH (sh
or bash
) but in many cases you will have to specify which shell to use, and the best way to do so is to put #!/bin/bash
(#!/usr/bin/env bash
on MacOS) of every script. #!/bin/bash
will force use of bash
, if file is executed by giving it execution permission and running it with ./start.sh
One fact:
- Bourne shell is
sh
- Bourne Again shell
bash
I cannot figure out what's the problem to employ './start.sh'
do this:
ls -l start.sh
you should get something like this:
-rw-r--r-- 1 <username> <group> 1 Mar 17 08:57 start.sh
there lays your problem. You do not have executive rights to it. If your username is not same as <username>
, but you are member of a group <group>
you could do following:
chmod g+x start.sh
You can give everybody else (not the <user>
and not the member of the <group>
) execution permission (REALLY BAD IDEA) by doing this:
chmod o+x start.sh
To give execution permission to all users:
chmod +x start.sh
which is also a bad idea.