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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -