I am listing the files/directories which are greather than N days using the below commands
DATE=`date +%Y-%m-%d`
dt=`date --date "$dt" +%Y%m%d`
loop_dt=`date -I --date "$dt -1 day"`
*** output of loop_dt = 2018-02-25***
hdfs dfs -ls r /path/ | awk '$6 < "$loop_dt"'
I know the above hdfs command is wrong, But I want to pass the loop_dt varible in awk command, to know the list the files which are older than n days
Note: if I hardcode the date in awk command I am getting the results