You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by David Medinets <da...@gmail.com> on 2013/05/02 04:59:28 UTC

[ -d "$HADOOP_PREFIX" ] -- does this work with symbolic link? Doesn't seem to for me.

I'm looking at the config.sh script:

if [ ! -d "$HADOOP_PREFIX" ]
then
   echo "$HADOOP_PREFIX is not a directory."
   exit 1
fi

On my system, HADOOP_PREFIX points to a symbolic link and this test is
failing. I'm sure it was working a few weeks ago. Changing the code to:

hadoop_prefix_directory_test=`test -d $HADOOP_PREFIX; echo $?`
if [ hadoop_prefix_directory_test == 1 ]
then
   echo "HADOOP_PREFIX, which has a value of $HADOOP_PREFIX, is not a
directory."
   exit 1
fi

does work on my system. I'm betting user error on my part. Can someone
confirm that the -d syntax works for a symbolic link?

Re: [ -d "$HADOOP_PREFIX" ] -- does this work with symbolic link? Doesn't seem to for me.

Posted by Christopher <ct...@apache.org>.
What version of bash is on your system? It works for me. test and [ ]
do the same thing.
Does replacing [ with [[ and ] with ]] work?

--
Christopher L Tubbs II
http://gravatar.com/ctubbsii


On Wed, May 1, 2013 at 10:59 PM, David Medinets
<da...@gmail.com> wrote:
> I'm looking at the config.sh script:
>
> if [ ! -d "$HADOOP_PREFIX" ]
> then
>    echo "$HADOOP_PREFIX is not a directory."
>    exit 1
> fi
>
> On my system, HADOOP_PREFIX points to a symbolic link and this test is
> failing. I'm sure it was working a few weeks ago. Changing the code to:
>
> hadoop_prefix_directory_test=`test -d $HADOOP_PREFIX; echo $?`
> if [ hadoop_prefix_directory_test == 1 ]
> then
>    echo "HADOOP_PREFIX, which has a value of $HADOOP_PREFIX, is not a
> directory."
>    exit 1
> fi
>
> does work on my system. I'm betting user error on my part. Can someone
> confirm that the -d syntax works for a symbolic link?