0

I am trying to understand the following

$ HDFS_FILE = 'hdfs:///user/svcid/project/app/sample.txt'

-ksh: HDFS_FILE: not found [No such file or directory]

But whenI remove space between

HDFS_FILE< >=< >'hdfs:///user/svcid/project/app/sample.txt'

then it works fine.

$ HDFS_FILE='hdfs:///user/svcid/project/app/sample.txt'


$ echo $HDFS_FILE

hdfs:///user/svcid/project/app/sample.txt

Why does it behave like that?

geenie
  • 1
  • 1
  • Spaces are used to separate a command from its arguments. If you put a space there, it thinks `HDFS_FILE` is the name of the command to run, and `=` is the first argument. – Barmar Jun 15 '21 at 05:57
  • Assignments can't have any whitespace around the `=`. – Barmar Jun 15 '21 at 05:58

0 Answers0