|
From: | Bob Proulx |
Subject: | Re: [Help-bash] Current working directory echoed to the terminal |
Date: | Mon, 9 Apr 2012 17:07:09 -0600 |
User-agent: | Mutt/1.5.21 (2010-09-15) |
Chris Jones wrote: > I ran the script like so: > > | $ (unset BASH_ENV; myscript) > > .. and the directory is no longer echoed to the terminal. Why is the BASH_ENV variable set? The easiest and best solution would seem to be to find where that is getting set and remove it so that it isn't ever set. The ksh needed ENV set in order to source a ksh envirionment script. And so bash has that too as a compatibility option. And also has BASH_ENV which for a bash specific override. But in all of the years I have been using shells I haven't ever needed to set BASH_ENV. Instead I let the automatic bashrc file processing do everything. I think sometimes that people converting over from the old ksh to bash sometimes get suckered into thinking they need more configuration than they do and the go looking for how to set the same options they used to set with ksh. But in this case it just isn't needed. If you think it is then please write back and say why. I am sure we can come up with a better way of doing things. > Unsure about the implications but for now I changed the two ‘cd -’ > commands to ‘cd - > /dev/null’ and the directory name is no longer > echoed to the terminal. The implications are that you are doing something as a workaround to stop doing something else that you set it up to do. I think it is better to stop doing the thing you don't want it to do in the first place and then there isn't a need for a workaround. Do you really need CDPATH set? Bob
[Prev in Thread] | Current Thread | [Next in Thread] |