From owner-freebsd-questions@FreeBSD.ORG Tue Jun 13 16:26:43 2006 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 CE85A16A46F for ; Tue, 13 Jun 2006 16:26:43 +0000 (UTC) (envelope-from alfred.morgan@adecn.com) Received: from mail.adecn.com (mail.adecn.com [209.10.222.107]) by mx1.FreeBSD.org (Postfix) with SMTP id 426AC43D5E for ; Tue, 13 Jun 2006 16:26:43 +0000 (GMT) (envelope-from alfred.morgan@adecn.com) Received: (qmail 44795 invoked by uid 0); 13 Jun 2006 16:27:48 -0000 Received: from unknown (HELO ?192.168.102.54?) (alfred.morgan@adecn.com@unknown) by unknown with SMTP; 13 Jun 2006 16:27:48 -0000 Message-ID: <448EE73D.1010606@adecn.com> Date: Tue, 13 Jun 2006 09:26:37 -0700 From: Alfred Morgan User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060213 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: shebang line parsing changed in FreeBSD6 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: Tue, 13 Jun 2006 16:26:43 -0000 Can someone explain to me why parsing of the shebang line changed? ...for the worse in my opinion. I want to do this in FreeBSD6: #!/usr/bin/env python -u I can't do this because the shebang is evaluated as /usr/bin/env 'python -u' which causes an error. So I read the man page for env and find this: Note that the way the kernel parses the `#!' (first line) of an interpreted script has changed as of FreeBSD 6.0..., the first line should be changed to: #!/usr/bin/env -S /usr/local/bin/php -n -q -dsafe_mode=0 I changed my shebang line by adding -S and it works fine in FreeBSD6 but is not as portable. The -S option for env is new for FreeBSD6. This means my code is now not portable between FreeBSD6 and other operating systems including FreeBSD5. I stay with FreeBSD because I like the direction, practicality, and the people. Changes are usually made for the better but in this case I am left with one question. Why? -alfred