From 759a598215983867e4b5d4a641fac58fabcdf777 Mon Sep 17 00:00:00 2001 From: jrzvnn Date: Thu, 13 Jul 2023 04:42:52 +0800 Subject: [PATCH] Add rename script --- rename_script.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 rename_script.sh diff --git a/rename_script.sh b/rename_script.sh new file mode 100755 index 0000000..624cb82 --- /dev/null +++ b/rename_script.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +count=1 +prefix="manila_cathedral_" +folder="/home/jrzvnn/Documents/Projects/tour-in-tramuros/data/train/manila_cathedral/" + +cd "$folder" || exit + +for file in *; do + if [ "$count" -le 25 ]; then + extension="${file##*.}" + new_name="${prefix}${count}.png" + mv "$file" "$new_name" + ((count++)) + else + break + fi +done +