0

I have a bash shell script that contains the following command:

hadoop fs -get ${WORKING_DIRECTORY}${OUTPUT_FILE}

which resolves into

hadoop fs -get /tmp/out.csv

When I run the shell script, this command produces no output, and the file is not transferred to the local instance. However, if I run the command hadoop fs -get /tmp/out.csv directly on the shell, it works.

What am I missing?

Cam
  • 2,026
  • 3
  • 25
  • 42

1 Answers1

1

The issue could be with your script not seeing environment variables such as HADOOP_CONF, and using local filesystem instead of HDFS.

Make sure that .bashrc and .bash_profile are setup properly.

Also you should put set -x2 on top of your script just to make sure the variables are resolved the way you think they should.

Prefer running your scripts in strict mode 1 at least when debugging, will save you a lot of time.

andreoss
  • 1,570
  • 1
  • 10
  • 25