wangzhiyong 2 anni fa
parent
commit
1eb7ce9c77
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      logr.sh

+ 2 - 2
logr.sh

@@ -15,9 +15,9 @@ fi
 while [ $count -lt 20 ]
 do
   if [ -z "$3" ]; then
-    file=$(ls -rt "$dir" | grep "error" | head -n $((count + 1)) | tail -n 1)
+    file=$(ls -t "$dir" | grep "error" | head -n $((count + 1)) | head -n 1)
   else
-    file=$(ls -rt "$dir" | grep -v "$3" | head -n $((count + 1)) | tail -n 1 )
+    file=$(ls -t "$dir" | grep -v "$3" | head -n $((count + 1)) | head -n 1 )
   fi
   
   if [ -z "$file" ]; then