-
Notifications
You must be signed in to change notification settings - Fork 0
/
rename_master.sh
36 lines (29 loc) · 1.1 KB
/
rename_master.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# argument check
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <base_directory1> [<base_directory2> ... <base_directoryN>]"
exit 1
fi
# loop through all directories
for base_dir in "$@"; do
echo "Processing directory: $base_dir"
# source and target directories for renaming
access_master_dir="$base_dir/objects/access master"
access_dir="$base_dir/objects/access"
izotope_master_dir="$base_dir/objects/izotope master"
restoration_dir="$base_dir/objects/restoration"
# renames "access master" to "access" if it exists
if [ -d "$access_master_dir" ]; then
mv "$access_master_dir" "$access_dir"
echo "Renamed \"$access_master_dir\" to \"$access_dir\""
else
echo "Directory \"$access_master_dir\" does not exist."
fi
# renames "izotope master" to "restoration" if it exists
if [ -d "$izotope_master_dir" ]; then
mv "$izotope_master_dir" "$restoration_dir"
echo "Renamed \"$izotope_master_dir\" to \"$restoration_dir\""
else
echo "Directory \"$izotope_master_dir\" does not exist."
fi
done