I want to make changes to the color code of some SVG files. Usually, I use the following bash script:
#!/bin/bash
find -name "*.svg" -o -name "*.SVG" | while read i;
do
echo "This $i file will be updated"
fname=$( basename "$i")
fdir=$( dirname "$i")
sed -i -e 's/<old-color>/<newcolor>/g' "$i" #grey
done
The issue is that when I run this script on a symbolic linked file, the file changes to a normal separate file.
My idea is to exclude all symbolic link files so that only the original files are modified. But I don’t know how to do it.