store hdfs command output to a shell variable
<p>I am trying to the hdfs command output to a shell variable but am getting error. My script is as below:</p>

<pre><code>#!/bin/bash
default=$1
date="";
HDFS_PATH='/data/max_emp_value' (This is a directory)
if $(hadoop fs -test -e $HDFS_PATH/*); then
    date = "`hadoop fs -cat HDFS_PATH/*)`"
else
    date=$default
fi
echo date = ${date}
</code></pre>

<p>Thanks,
stacky</p>