{"id":270,"date":"2011-08-25T16:31:49","date_gmt":"2011-08-25T23:31:49","guid":{"rendered":"http:\/\/www.hongyu.org\/wordpress\/?p=270"},"modified":"2011-08-25T16:33:31","modified_gmt":"2011-08-25T23:33:31","slug":"strange-hadoop-error-caused-by-the-cdpath-environment-variable","status":"publish","type":"post","link":"https:\/\/www.hongyu.org\/wordpress\/?p=270","title":{"rendered":"Strange Hadoop error caused by the CDPATH environment variable"},"content":{"rendered":"<p>When I tried to run hadoop in my Linux box, I got a strange error:<\/p>\n<p><code>bin\/hadoop: line 53: \/home\/hzhang\/tools\/hadoop-0.20.203\/bin<br \/>\n\/home\/hzhang\/tools\/hadoop-0.20.203\/bin\/hadoop-config.sh: No such file or directory<\/code><\/p>\n<p>It said the hadoop-config.sh is missing, but clearly it&#8217;s there in my machine. After hair-scratching for quite a bit, I found out that it&#8217;s the line before 53 that caused error<\/p>\n<p><code>bin=`dirname \"$0\"`<br \/>\nbin=`cd \"$bin\"; pwd`<br \/>\n<\/code><br \/>\nThe reason is that I activated CDPATH in my shell, and the $bin variable therefore contains the same path repeated twice. All I have to do is turn it off by the following command:<br \/>\n<code>$ unset CDPATH<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I tried to run hadoop in my Linux box, I got a strange error: bin\/hadoop: line 53: \/home\/hzhang\/tools\/hadoop-0.20.203\/bin \/home\/hzhang\/tools\/hadoop-0.20.203\/bin\/hadoop-config.sh: No such file or directory It said the hadoop-config.sh is missing, but clearly it&#8217;s there in my machine. After hair-scratching for quite a bit, I found out that it&#8217;s the line before 53 that caused &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hongyu.org\/wordpress\/?p=270\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Strange Hadoop error caused by the CDPATH environment variable&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/270"}],"collection":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270"}],"version-history":[{"count":3,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions"}],"predecessor-version":[{"id":273,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions\/273"}],"wp:attachment":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}