Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this simple script:

$(hadoop fs -ls)

The output is:

./ line 3: Found: command not found

So bash definitely sees HADOOP_HOME. I've set it in ~/.profile and added path to bin folder:

export HADOOP_HOME="/opt/hadoop-0.20.2-cdh3u2"

If I simply invoke command in console everything works but inside a script it doesn't. What am I doing wrong?

share|improve this question
up vote 2 down vote accepted

It's not the problem with echo ${HADOOP_HOME} command.The one which causes the error is $(hadoop fs -ls)

You have to give the 3rd line in that script as echo $(hadoop fs -ls). So the script will look like,

echo $(hadoop fs -ls)

If you give the command like this $(hadoop fs -ls), bash parses it and find it's value. And the founded value is again parsed by bash.


$ var=4
$ $var
4: command not found
$ echo $var

IMO, the value or the output of the command hadoop fs -ls is Found, this string found was again parsed by bash when you give the command like this $(hadoop fs -ls). So that the below error message displayed while executing the script,

./ line 3: Found: command not found
share|improve this answer
Oh, so simple. Thanx a lot! I'll accept answer as soon as I can. – Moses Apr 29 '14 at 7:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.