avast / hdfs-shell

HDFS Shell is a HDFS manipulation tool to work with functions integrated in Hadoop DFS
Apache License 2.0
150 stars 33 forks source link

cmdfile option does not seem to be working #13

Closed be-rock closed 9 months ago

be-rock commented 6 years ago

Hi,

I would like to use this tool programmatically to getfacl on many directories and write the output to a file via stdout. It is not clear how to use this --cmdfile option and did not see any examples in the docs.

$ ./hdfs-shell.sh --help
Usage:  --help --histsize [size] --cmdfile [file name] --profiles [comma-separated list of profile names]

$ cat ~/tmp.txt
getfacl /valid/hdfs/directory/file.txt
hdfs dfs -getfacl /valid/hdfs/directory/file.txt

$ ./hdfs-shell.sh --cmdfile ~/tmp.txt
$ # nothing happens here

How does this API work. Am I misunderstanding the help options?

Thanks.

Vity01 commented 6 years ago

The help description comes from Spring Shell, I forgot to remove it. Please use the script command for launching commands from file this way:

$./hdfs-shell.sh script ~/tmp.txt

Edit: Spring Shell help message is hardcoded and it's impossible to change it right now (in the version 1.2). Hopefully it will be fixed with an Spring Shell upgrade in the future.

be-rock commented 6 years ago

I have confirmed that the "script" argument is providing the desired functionality in version 1.0. The help message is the only missing. Thanks and keep up the great work.