Updating note for May 28, 2005 Change in handling of shell-script options The way that the FreeBSD kernel parses extra options on the first line of shell-scripts has changed. The first line of a shell script has the form of: #! interpreter [ option... ] If a script has multiple options listed after the interpreter name, then the script will probably behave differently after this change. Most scripts specify only the interpreter name, or specify the interpreter name plus a single option, so most scripts will not be effected by this change. The reason for making this change is that the previous behavior did not match the way that any other operating system handles multiple options on that line. Before this change, the kernel would setup each option as a separate argument in the list of arguments given to the interpreter. After the change, the kernel will setup a single extra argument which has all of the options that were found (including any whitespace between the options). SOME EXAMPLES: For instance, you might have a script named 'MyScript' where the first line of the script is: #!/usr/bin/env SOMEVAR=value perl And the user executes that script by typing: /tmp/MyScript -user1 -user2 Before this change, the `env' program would be called with an argument list of: [0] -> /usr/bin/env [1] -> SOMEVAR=value [2] -> perl [3] -> /tmp/MyScript [4] -> -user1 [5] -> -user2 So `env' will set the value of "SOMEVAR" to "value", and then it will execute whatever version of perl that in can find in the user's PATH with the remaining arguments. After this change, the `env' program will be called with an argument list of: [0] -> /usr/bin/env [1] -> SOMEVAR=value perl [2] -> /tmp/MyScript [3] -> -user1 [4] -> -user2 In this case, `env' sets the value of "SOMEVAR" to "value perl", and then executes /tmp/MyScript -- which means the script will just keep executing itself over and over again. Another example would be a script which starts with: #!/usr/bin/env ruby -w Before the change, `env' will execute the program "ruby", with an added argument of "-w". After the change, `env' will look for a program which is literally named "ruby -w" (including the blank). It will probably not find that program, and if you try to run the script it will fail with the message: env: ruby -w: No such file or directory Note that /bin/sh has already been changed to support the often-recommended trick of starting a script with: #!/bin/sh -- # -*- perl -*- So while this change *would* have broken scripts which used the above trick, most of those scripts should continue to work due to a recent commit to /bin/sh. While this change should not effect too many scripts, it is a significant and incompatible change for the scripts that it does effect. For the complete discussion leading up to this change, check the thread named "Bug in #! processing - One More Time" on the freebsd-arch mailing list, which started on February 24th, 2005.