0

I'm trying to copy a file with a ^ in the file name and getting error.

hdfs dfs -copyFromLocal /tmp/BC10^Dummy* /user/app

I'm getting below error:

copyFromLocal: unexpected URISyntaxException

I suspect the ^ is causing the error but it's not a space so how do I get around this issue? I can't rename the file, that's not an option.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Hua Cha
  • 107
  • 1
  • 9
  • This might help: [URL encoding a string in bash script](https://stackoverflow.com/q/11876353/3776858) – Cyrus Sep 11 '19 at 04:31

1 Answers1

0

You need to convert ^ as %5E

/tmp/BC10^Dummy* --> /tmp/BC10%5EDummy*

Try below command :

hdfs dfs -copyFromLocal /tmp/BC10%5EDummy* /user/app
Pacifist
  • 3,025
  • 2
  • 12
  • 20
  • The %5E worked but I'm facing a different error now. ```copyFromLocal: `/tmp/GC10^Dummy*': No such file or directory``` I can see the quotes seem different. But how do I correc that? The code in Python is: ```subprocess.call(["hadoop fs -copyFromLocal /tmp/GC10%5EDummy* /user/app"], shell=True)``` – Hua Cha Sep 11 '19 at 04:38