From 7d36763d99e86e238e27dd463358cbd95a90a932 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Tue, 5 Jul 2022 11:20:58 +0530 Subject: another for loop for numbering the orderedbydate foldername --- .scripts/order | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.scripts/order b/.scripts/order index 155e039..4d6dd48 100644 --- a/.scripts/order +++ b/.scripts/order @@ -7,8 +7,18 @@ for f in * ; do mv -n "$f" "$(date -r "$f" +"%Y%m%d_%H%M%S")_$f"; done -#open in vimv -#let @a=1 | g/^.\{0,16}/s//\=i.'.' | let i=i+1 +##open in vimv +#let @a=1 | g/^.\{0,16}/s//\=i.'. ' | let i=i+1 +#add zero in front use period to repeat as necess + +i=1; +for d in * ; +do mv -n "$d" "$(ls | sed '=' | sed 'N;s/\n/. /' | awk -v i=$i 'NR==i')" && i=$((i+1)); +done + + #add zeroes in front if lenofnod = 1 -#add zeroes in front if lenofnod = 2 + +#for f in * +#do rename -- cgit v1.2.3