I am writing a script to change size of svg images. Here is what I am trying
#!/bin/bash
for file in *
do
rsvg-convert "$file" -w 160 -h 160 -f svg -o `echo $i | sed -e 's/svg$/new.svg/'`
done
But this is not working.
Use bash substitition directly (${file%.svg} will remvoe .svg from the end of file variable):
#!/bin/bash
mkdir -p folder
for file in *
do
rsvg-convert "$file" -w 160 -h 160 -f svg -o folder/${file%.svg}new.svg
done