From owner-freebsd-questions@FreeBSD.ORG Thu Dec 1 19:11:52 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9EED16A41F for ; Thu, 1 Dec 2005 19:11:52 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2493A43D7D for ; Thu, 1 Dec 2005 19:11:46 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-8) with SMTP id jB1JBixO030037; Thu, 1 Dec 2005 21:11:45 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jB1JB7mc064188; Thu, 1 Dec 2005 21:11:07 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jB1JB7wr064187; Thu, 1 Dec 2005 21:11:07 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 1 Dec 2005 21:11:07 +0200 From: Giorgos Keramidas To: Blue Raccoon Message-ID: <20051201191107.GA64113@flame.pc> References: <20051201173603.3E9EC16A427@hub.freebsd.org> <20051201185956.ee767f97.blue.raccoon@wanadoo.nl> <20051201181512.GA63703@flame.pc> <20051201194850.42578863.blue.raccoon@wanadoo.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051201194850.42578863.blue.raccoon@wanadoo.nl> Cc: freebsd-questions@freebsd.org Subject: Re: Can't run scripts no more: "permission denied" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2005 19:11:53 -0000 On 2005-12-01 19:48, Blue Raccoon wrote: > On Thu, 1 Dec 2005 20:15:12 +0200 > Giorgos Keramidas 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