Unable to determine Hadoop version information
===

Below is my updated shell script that I am using currently- I am trying to run my Hive query and storing the output in `foo.txt` file.

    #!/bin/bash
    HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
    export HIVE_OPTS
    HADOOP_HOME=/home/hadoop/latest
    export HADOOP_HOME
    hive -S -e 'SELECT count(*) from testingtable1' > foo.txt


And I need to execute the above shell script using `PLINK` on `MachineB` from `MachineA(Windows Machine)`.

And when I try to do it like this-

    C:\PLINK>plink uname@machineB -m email.sh
    Using keyboard-interactive authentication.
    Password:
    Using keyboard-interactive authentication.
    Your Kerberos password will expire in 73 days.
    
I get this below exception on windows cmd prompt

    /apache/hive/bin/hive: line 107: [: too many arguments

But when I try to open `foo.txt` file on MachineB I found these things-

    bash-3.00$ cat foo.txt
    Unable to determine Hadoop version information.
    'hadoop version' returned:
    Error: JAVA_HOME is not set.

Any suggestion why it happening?