You need to have Inkscape installed and in your path for this to work.
#!/bin/bash INPUT=$1 if [ -n "$2" ] then OUTPUT=$2 else OUTPUT=${INPUT%.*}.eps fi echo Converting $INPUT to $OUTPUT... inkscape --export-text-to-path --export-bbox-page --without-gui --file=$INPUT --export-eps=$OUTPUT &> /dev/null
I decided to redirect stdout and stderr to /dev/null as Inkscape is quite verbose when it doesn't like something about the svg you are making it convert. Feel free to comment that &> /dev/null out if you want to be hit with the full verbosity though ;)
Hint: If you want to preprocess the svg's contents prior to conversion (e.g. for removing certain parts using grep -v), pipe the output of the preprocession step to the inkscape-call and make it use /dev/fd/0 (stdin) as input file instead of $INPUT.
svg2eps infile.svg outfile.eps – Converts infile.svg to outfile.epssvg2eps file.svg – Converts file.svg to file.epsThe Inkscape-Fu was based on this entry in the lyx wiki.