mirror of
https://github.com/NotAShelf/catApi.git
synced 2025-10-03 15:33:34 +00:00
rewrite in go
This commit is contained in:
parent
5203a18d2d
commit
05642cb93b
743 changed files with 334055 additions and 55 deletions
29
test.sh
Executable file
29
test.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Directory containing the images
|
||||
image_directory="images"
|
||||
|
||||
# Set the starting number
|
||||
number=0
|
||||
|
||||
# Set the maximum number for renaming (change this to your desired limit)
|
||||
max_number=100
|
||||
|
||||
# Loop through the image files in the directory and rename them
|
||||
for image in "$image_directory"/*; do
|
||||
# Check if we've reached the maximum number
|
||||
if [ "$number" -gt "$max_number" ]; then
|
||||
echo "Reached the maximum number for renaming."
|
||||
break
|
||||
fi
|
||||
|
||||
# Get the file extension
|
||||
extension="${image##*.}"
|
||||
|
||||
# Rename the image with the current number
|
||||
new_name="${image_directory}/${number}.${extension}"
|
||||
mv "$image" "$new_name"
|
||||
|
||||
# Increment the number
|
||||
number=$((number + 1))
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue