Hadoop Count command

Hi,
I am using below command to assign a value, But for some reasons hdfs -count is not allowed due to security reason. Is there a alternative way to get by tweaking the code

var=hdfs dfs -ls /hdfs_path/ | grep col=2020_03 | awk -F' ' '{system("hdfs dfs -count "$8)}' | awk -F' ' '{if ($3 != 0) print $4}' | awk -F'=' '{print $2}'|sort -nr | uniq | head -1

/hdfs_path/col=2020_03_20

What happens when you run the most simple variation of your command from the command line?

hdfs dfs -count  < your value >

Basically our admins have restricted runing -count command due to security concerns. It gives error as disabled. I know they have applied restrictions

The best is for you talk to your sys admins and get the sys admin permissions you require.

We do not support attempts by anyone to subvert any security controls put in place on their systems.