Robert Russell wrote: > On 5/19/05, Bryan Kadzban <[EMAIL PROTECTED]> wrote: > >> We could use the "enable" builtin to disable the builtin versions >> in bash: >> >> enable -n test [ >> >> I'm (again) not sure about other shells, though... > > > Wouldn't the binaries in /bin be used if the shell did not have > builtins? >
Yes, but the problem would come in if there's some shell out there that does have "test" and "[" builtins, but doesn't have an "enable" command that we can use to turn them off. For example, the ash(1) man page here: http://www.strw.leidenuniv.nl/cgi-bin/man?program=ash§ion=1 doesn't say anything about an "enable" builtin in ash. It may be that there is no such builtin, which would cause problems if we did that. However, we might be able to do something with exec in a subshell instead (since exec won't run a builtin or function, only an executable): if ( exec [ -r file1 ] ) ; then do_whatever ; fi I can't decide if that's more or less ugly than: if /bin/[ -r file1 ] ; then do_whatever ; fi though. It is a few characters longer, for whatever that's worth.
signature.asc
Description: OpenPGP digital signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page