0

I want to compare two text files for changes line by line. If the files are store locally I know I can do it with

grep -Fxvf file1 file2

I have a problem because file 2 is in Hadoop File System. I can read this file with the command

hadoop fs -cat /filepath/file2

So naturally I want to feed this result to grep. I tried something like

 grep -Fxvf file1 ${hadoop fs -cat /filepath/file2}

but I get

-bash: ${hadoop fs -cat /filepath/file2}: bad substitution

I tried to use xargs also but with no luck. I appreciate any help.

0

1 Answer 1

1

Thanks to @dsstorefile1 I solved it with

grep -Fxvf <(hadoop fs -cat /fielpath/file2 ) file1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .