将 hdfs 文件与 unix 文件进行比较,出现错误



>我正在为这段代码syntax error near unexpected token (。它运行良好,直到我在其中输入diff行:

shopt -s nullglob
for f in *.csv
hdfs dfs -test -e $target_dir/$f
if [ $? = 0 ]
then
echo File exists. check if its same hadoop v unix
if diff <(hdfs dfs -cat $target_dir/$f) <(cat $f)
then
echo Files are the same
fi
fi
done

有什么想法吗?谢谢

for f in *.csv; do
hdfs dfs -test -e "$target_dir/$f"
rc=$?
if [[ "$rc" == 0 ]]; then
echo "File exists. check if its same hadoop v unix"
if diff <(hdfs dfs -cat "$target_dir/$f") <(cat "$f") ; then
echo "Files are the same"
fi
fi
done

你的做/同时,如果语法是错误的。

最新更新