list all folder names in directory - unix shell script -
how can list of folder using shell script, directory present in hdfs. here have tried :
#!/bin/ksh echo " loading folders..." count=0 folder in `hdfs dfs -ls -d /user/data/*` if [ -d "$folder" ] count=`expr $count + 1` echo ${d} fi done echo ${count}
this value of count variable 0 @ end of program.
you need ask hdfs if folder directory, not bash.
if hdfs dfs -test -d "$folder";
Comments
Post a Comment