This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
software:inkscape_scripts [2016/05/08 01:41] admin [make path objects] |
software:inkscape_scripts [2016/05/11 21:47] (current) admin |
||
---|---|---|---|
Line 66: | Line 66: | ||
svg="$(cat ${DNM}/${SFX}/${NF})" | svg="$(cat ${DNM}/${SFX}/${NF})" | ||
- | # Strip everything until after the first appearance of '<path' | + | # Strip everything until after the first appearance of '<path': |
+ | # grep $svg first to prevent the subsequent substring removal to freeze | ||
+ | # in case of embedded images in svg files. | ||
+ | svg=$(echo $svg | grep -oP '<path.*') | ||
svg="${svg#*<path}" | svg="${svg#*<path}" | ||
| | ||
Line 89: | Line 92: | ||
# check if $svg still contains '<path', if yes, cut off everything until after the next first <path: | # check if $svg still contains '<path', if yes, cut off everything until after the next first <path: | ||
if [[ $svg == *"<path"* ]]; then | if [[ $svg == *"<path"* ]]; then | ||
+ | # Strip everything until after the first appearance of '<path': | ||
+ | # grep $svg first to prevent the subsequent substring removal to freeze | ||
+ | # in case of embedded images in svg files. | ||
+ | svg=$(echo $svg | grep -oP '<path.*') | ||
svg="${svg#*<path}" | svg="${svg#*<path}" | ||
else | else |