From owner-freebsd-questions@FreeBSD.ORG Thu Dec 1 19:23:21 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 B7B5616A41F for ; Thu, 1 Dec 2005 19:23:21 +0000 (GMT) (envelope-from willmaier@ml1.net) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 039D743D77 for ; Thu, 1 Dec 2005 19:23:14 +0000 (GMT) (envelope-from willmaier@ml1.net) Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id E7F05D1BB20 for ; Thu, 1 Dec 2005 14:22:29 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Thu, 01 Dec 2005 14:22:29 -0500 X-Sasl-enc: wdm2Y6s5sTkXl1kxs+cXQIZ8HHoGJGGFL4r9U0QigMit 1133464947 Received: from localhost (mdsnwikwbas08-pool4-a199.mdsnwikw.tds.net [69.129.195.199]) by frontend2.messagingengine.com (Postfix) with ESMTP id 3AA1157146E for ; Thu, 1 Dec 2005 14:22:27 -0500 (EST) Date: Thu, 1 Dec 2005 13:22:43 -0600 From: Will Maier To: freebsd-questions@freebsd.org Message-ID: <20051201192243.GG10377@merkur.atekomi.net> Mail-Followup-To: freebsd-questions@freebsd.org 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> User-Agent: Mutt/1.5.9i 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:23:21 -0000 On Thu, Dec 01, 2005 at 07:48:50PM +0100, Blue Raccoon wrote: > On Thu, 1 Dec 2005 20:15:12 +0200 > 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. But apparently the comment is not a comment. When I > remove it the script works (not from firefox, but that's a > different problem). That's not a (regular) comment, it's called 'sh-bang'. It tells the shell which command should be used to interpret the following code. For example, perl scripts usually start with #!/usr/bin/perl -w Which tells whatever shell you're running (like bash) to start perl as the interpreter for that script. In your case, you were trying to tell the shell to use bash as the interpreter. This is fine, as long as you have bash installed (it's not part of the FreeBSD base system). Moreover, you need to specify the correct path to the bash executable in your sh-bang. On FreeBSD, bash is usually installed via a port or package to /usr/local/bin. A better way of fixing your script (instead of just removing the sh-bang altogether) would be to edit it to read as follows: #!/bin/sh That'll point to FreeBSD's sh implementation, which is the standard Unix shell. Some Linuxes will use bash as their sh, but most BSDs use a more standard sh. Writing shell scripts for sh (and not bash, ksh or whatever) is a good idea as it will make your scripts easier to port to other systems. bash is similar to sh, so you might not need to change anything (unless you're using lots of bashisms or arrays or whatnot). -- o--------------------------{ Will Maier }--------------------------o | jabber:..wcmaier@jabber.ccc.de | email:..........wcmaier@ml1.net | | \.........wcmaier@cae.wisc.edu | \..........wcmaier@cae.wisc.edu | *------------------[ BSD Unix: Live Free or Die ]------------------*