Can't run scripts no more: "permission denied"
Giorgos Keramidas
keramida at ceid.upatras.gr
Thu Dec 1 11:11:53 PST 2005
On 2005-12-01 19:48, Blue Raccoon <blue.raccoon at wanadoo.nl> wrote:
> On Thu, 1 Dec 2005 20:15:12 +0200
> Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> > When did those scripts run fine? What did you change since then?
>
> First of all I've been stupid. I used
> # ./ script.name
> when I should have used
> # ./script.name
>
> Apparently, this is what causes the "permission denied".
Correct.
> And I now remembered I started doing it this (wrong) way because I
> could not run the 'sylpheed' script. As a newbie I had doubts... maybe
> there should be a space?...
No. The strange "./" string before the path of the script is just a way
of telling to your shell that "yes, I really mean that you have to look
for the executable of this program under the current directory". So,
you shouldn't use a space.
> But the 'sylpheed' script still would not run: "command not
> found". There is only one command in the file (which works fine on the
> command line) and a comment: #!/bin/bash I copied the script from the
> web.
There is no /bin/bash executable in FreeBSD. This is a false assumption
that Linux users tend to fall for. If the script doesn't use any
special, bash-specific constructs and it works fine with /bin/sh you can
replace /bin/bash with /bin/sh in that line.
> But apparently the comment is not a comment. When I remove it the
> script works (not from firefox, but that's a different problem).
It's not a comment. When a script starts with a line of the form:
#!/some/path/to/an/intepreter/binary
then FreeBSD recognizes this as a special "comment" and it runs the rest
of the script (starting from line 2) as an interpreted script. The
effect is pretty much the same as typing manually something like:
/some/path/to/an/intepreter/binary script-file
All these minor details are explained in detail in many books about
using UNIX. It will help a great deal if you read at least one of the
introductory texts about UNIX. Since you are apparently new to UNIX,
suggested reading material is:
"For People New to Both FreeBSD and UNIX"
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/new-users/
"FreeBSD Handbook"
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/
Other FreeBSD documents, can be found at:
http://www.FreeBSD.org/docs.html
The Handbook contains a nice bibliography chapter, that will point you
to even more reading material, if you find that you need it :)
- Giorgos
More information about the freebsd-questions
mailing list