I'm wondering if anyone has any suggestions. I'm trying to disable
hashing in scripts that my scripts call. I have set +h in my .bashrc,
but children shells are not inheriting the setting. I still have to
pass along the +h, which I'm currently doing with "bash +h ...", but
this is problematic; there is nothing to guarantee that a script I call
doesn't call another script which reactivates hashing for itself. It
really shouldn't be that big of a problem as I'm not building anything
in parallel, but I'd still like to implement this in my scripts (call
it peace of mind). Also, I'm looking for a solution which doesn't
require root privileges ie. I don't want to alter the default bashrc,
or wherever the default hash setting is located (I say 'wherever'
because I have not looked; it's just not an option!).
I have done some reading: Advanced Bash-Scripting guide from tldp.org,
and Bash Reference manual from gnu.org. I'll admit I have not read them
in their entirety yet, and there is a good chance the answer is still
to be found there. I'll be looking more later, but for now I was
wondering/hoping someone knows what I'm talking about and can point me
in the right direction.
Another request while I'm at; is there something similar to printenv to
list all of bash's settings? Anyhow, that's probably something I can
find on my own ;p. I ask because I'm now lead to wonder what children
shells are actually inheriting and this 'phantom call' would sure help
figure that out.
Below is example code to help illustrate the posts 'main' request.
-----
Start of code.
-----
#!/bin/bash +h
# test1
#####
# Purpose:
# Trying to figure out how to disable hashing in invoked scripts
# without altering the called script. Basically, I want to be sure
# that if I write a script that invokes another script hashing
# will not reactivate.
#
# Test case:
# Moving mv
#
# Environment: You should have LFS build up to and including
# coreutils, or make a copy of mv and put it in your path and
# adjust the scripts accordingly.
#
#####
#
# This is the full code for test2.
#####
##!/bin/bash
## test2
#
#mv /tools/bin/mv .
#mv mv /tools/bin
#
#exit
#####
#####
# test1 code
#
export PATH=$PATH:$HOME # add test2 to the search path
mv /tools/bin/mv . # This is to test if
mv mv /tools/bin # hashing is off.
test2 # this can be replaced with bash +h test2 for my own scripts,
but
# it's not 'the' solution.
exit
-----
End of code.
-----
Any help is appreciated,
Trent.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page