14 lines
347 B
Bash
Executable File
14 lines
347 B
Bash
Executable File
#!/bin/bash
|
|
# Rename all .png files in this directory to lowercase with underscores replacing spaces.
|
|
|
|
cd "$(dirname "$0")" || exit 1
|
|
|
|
for f in *.png; do
|
|
[ -f "$f" ] || continue
|
|
newname=$(echo "$f" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
|
|
if [ "$f" != "$newname" ]; then
|
|
mv "$f" "$newname"
|
|
echo "Renamed: $f -> $newname"
|
|
fi
|
|
done
|