-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Brian Matheson on 4/18/2007 8:34 PM: > Old behavior: > red:~$ basename $0 > -bash
Broken. > > New behavior: > orange:~/lib/sh$ basename $0 > basename: invalid option -- b > Try `basename --help' for more information. Correct behavior, but undesired results. So what you really wanted to do: basename -- "$0" This correctly handles the case when $0 contains shell metacharacters, as well as when it starts with -. > > Looks like a misbehavior in option parsing. No, just a misunderstanding on your part. POSIX requires the current behavior. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGJtzR84KuGfSFAYARAi9SAKC1lELw/+J6mLYBQ8hyIRcOAwWn9ACg1apm cs2wFv7zfGaZDV95JD6nxYc= =79ow -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils