Just thought I'd post for those folks who script.

When you switch to the new environment and/or new instance of bash in Chapter 6, your disablement of hashing via the 'set -h' type of command may be effective in your interactive shell and not in any scripts that you invoke, unless those scripts are sourced of course (. or source imperatives are used).

This poses some small risks in certain operations. One example occurs in coreutil install wherein mv is "remembered" as being in /usr/bin after it has been moved to /bin. Move commands on subsequent lines may fail.

Another gentle reminder comes in module-init-tools install when '/bin/true' is used (a net effect of --prefix=/ or just hard coding: I'm not sure) and not found because the 'mv' of it in the coreutils install stopped working (due to hashing) before true was moved.

An effective way to avoid the problem is either source your script, e.g.

   . <scriptname>
-- or--
   source <scriptname>

or set your hash off on the interpreter specification line like so

   #!/bin/bash +h
   # more script junk here.

Of course, if you are manually C&P commands into an interactive session, the problem should not occur. A simple test, mentioned in the book IIRC:

  hash

--
W.I.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to