17 lines
453 B
Bash
17 lines
453 B
Bash
#!/bin/bash
|
|
|
|
# Check if both arguments are provided
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage: $0 <old_color> <new_color>"
|
|
echo "Example: $0 556ee6 2A9D8F"
|
|
exit 1
|
|
fi
|
|
|
|
old_color=$1
|
|
new_color=$2
|
|
|
|
# Find all .html, .css, and .js files and replace the color
|
|
find . -type f \( -name "*.html" -o -name "*.css" -o -name "*.js" \) -print0 | xargs -0 sed -i "s/$old_color/$new_color/g"
|
|
|
|
echo "Color replacement complete: $old_color replaced with $new_color"
|