organize count

This commit is contained in:
oct2pus 2024-04-08 01:51:59 -05:00
parent 5f399de258
commit 016b68e8c3
8 changed files with 27 additions and 0 deletions

8
count/count.fish Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env fish
set files (./golf lol)
echo (count $files)

19
count/count.mockup Normal file
View File

@ -0,0 +1,19 @@
files = number of files in arg[1] # likely going to be named sql-backup
if files > arg[2] # specified number of files to keep
fileList = array of files in arg[1]
oldestDate = fileList[1] date created # doesn't matter which file
fileIndex = 1 # or 0 but fish just uses index 1 for the beginning of an array
for i = 1; i > files; i++
dateCreated = fileList[i] date created
if oldestDate < dateCreated
oldestDate = dateCreated
fileIndex = i
end
end
delete fileList[fileIndex]
end

BIN
count/golf Executable file

Binary file not shown.

0
count/test/1 Normal file
View File

0
count/test/2 Normal file
View File

0
count/test/3 Normal file
View File

0
count/test/4 Normal file
View File

0
count/test/5 Normal file
View File