#!/bin/bash if [ "$#" -ne 5 ]; then echo "Usage: $0 " echo "Example: $0 wall.svg wall.repainted.svg 073642 B58900 586E75" exit 1 fi sourceFile=$1 targetFile=$2 new_bg=$3 new_fg=$4 new_shadow=$5 cp $sourceFile $targetFile sed -i "s/#222222/#$new_bg/g" "$targetFile" sed -i "s/#444444/#$new_fg/g" "$targetFile" sed -i "s/#262626/#$new_shadow/g" "$targetFile" echo "Colors replaced" echo "$targetFile: bg=$new_bg, fg=$new_fg, shadow=$new_shadow"