• This project
    • Loading...
  • Sign in

Hooke / map-demo

Itomix
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • map-demo
  • images
  • tiles
  • 17sh
  • 2.sh
  • hookehuyr's avatar
    新增自动生成文件名的脚本 · 7ec5de01
    7ec5de01
    hookehuyr authored 2023-07-03 11:22:28 +0800
2.sh 362 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash

parent_folder="./target/"  # 替换为实际父文件夹路径
start_x=109439
start_y=53519
y=$start_y

for folder in "$parent_folder"*/; do
  x=$start_x
  for filename in "$folder"*.png; do
    if [ -f "$filename" ]; then
      new_filename="$folder$x"_"$y.png"
      mv "$filename" "$new_filename"
      x=$((x+1))
    fi
  done
  y=$((y+1))
done