[ 
https://issues.apache.org/jira/browse/HADOOP-6101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899263#action_12899263
 ] 

Eli Collins commented on HADOOP-6101:
-------------------------------------

What version of bash are you using and what's your CDPATH?  Looking at the way 
the bin scripts from 19 to trunk, cd is given an absolute path, ".", or one 
that starts with "./"  from dirname, and bash won't use CDPATH (and print to 
stdout) if that's the case doesn't seem to use CDPATH used to stdout if that's 
the case (even though the manual claims it . 

{code}
bin=`dirname "$0"`   # or bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd`
{code}

1. http://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html
2. http://www.opengroup.org/onlinepubs/009695399/utilities/cd.html

We can unset CDPATH in the bin scripts but it doesn't look like it should fix 
anything.


> CDPATH environment variable causes bin scripts to fail.
> -------------------------------------------------------
>
>                 Key: HADOOP-6101
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6101
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.19.1
>            Reporter: Phil Hagelberg
>            Priority: Minor
>
> Most of the scripts in bin/* assume that cd produces no output. But when 
> using bash (and some other shells) cd will output the destination directory 
> if the CDPATH environment variable is set. CDPATH is very useful, and it's 
> unfortunate to have to unset it to use Hadoop.
> The offending line (in start-all.sh, though most of the scripts exhibit the 
> problem) is:
>   bin=`cd "$bin"; pwd`
> Adding this to the top of each affected script will fix the problem:
>   unset CDPATH

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to