applied-ai-018's picture
Add files using upload-large-folder tool
c040012 verified
raw
history blame contribute delete
483 Bytes
#!/bin/bash
path="/software/users/msinha/share/sd/Final_Submission/results"
str="-"
declare -A dir_cr_times
for dir in "$path"/*/;
do
if [ -d "$dir" ] && [[ "$dir" == *"$str"* ]] ; then
cr_time=$(stat -c %Y "$dir")
dir_cr_times["$dir"]=$cr_time
fi
done
sorted_dirs=($(for dir in "${!dir_cr_times[@]}"; do
echo "$dir_cr_times[$dir]"
done | sort -n -r -k2 | awk '{print $1}'))
for dir in "${sorted_dirs[@]}"; do
d_p=${dir%"]"}
d_p=${d_p#"["}
echo ${d_p}
done