diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-07-05 11:20:58 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-07-05 11:20:58 +0530 |
commit | 7d36763d99e86e238e27dd463358cbd95a90a932 (patch) | |
tree | e7266c20ae4c219772453ea738f125e9e16746c7 /.scripts | |
parent | 5a9f4d37f4ed192d84b27472a1ad84cf6db13cd7 (diff) |
another for loop for numbering the orderedbydate foldername
Diffstat (limited to '.scripts')
-rw-r--r-- | .scripts/order | 16 |
1 files 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 |