command lookup and POSIX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reading this:

http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01_01

Any built-in other than the special built-ins, or listed in the table
there should not be run unless it is present in the PATH.

dash however doesn't follow that:

PS1="% " dash

    % PATH=
    % /usr/bin/which [
    /usr/bin/which: no [ in ()
    % [ -x f ]
    % 

Of course I can't find a single shell that follows this, even when
enabling its respective strict POSIX mode.  I'm guessing it was added to
prevent changes in behaviors of existing scripts as shells add more
builtins.

However, changing dash to comply also seems of dubious value since there
are many shell scripts out there that depend on common built-ins not
listed in POSIX.

However DASH claims POSIX compliance so I thought I would at least
mention it now that I found it.

-Jason
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux