If I make a directory with mkdir -p
, it causes problems with scripts
$ mkdir -p test2/test2
$ cd test2/test2
$ echo '#!/bin/sh
> echo hello' > hello.sh
$ ./hello.sh
bash: ./hello.sh: Permission denied
This is nothing to do with mkdir
. You simply haven't given hello.sh
executable permissions. You need the following:
chmod +x hello.sh