User:Silviolorusso/Mixsvg: Difference between revisions
No edit summary |
No edit summary |
||
Line 31: | Line 31: | ||
[[File:mix1.svg]] <br/> | [[File:mix1.svg]] <br/> | ||
<br/> | |||
[[File:mix2.svg]] <br/> | [[File:mix2.svg]] <br/> | ||
<br/> | |||
[[File:mix3.svg]] <br/> | [[File:mix3.svg]] <br/> |
Latest revision as of 17:56, 16 October 2011
A little script to mix two .svg files in one. Still not completely working.
#!/bin/sh
# a simple script to mix two .svg in one.
# Usage: command <file1> <file2>
cat $1 > temp.svg
# remove conflicting tags
awk 'match($0,"<svg") == 0 {print $0}' $2 > info
awk 'match($0,"<?xml") == 0 {print $0}' info > info2
awk 'match($0,"<!DOCTYPE") == 0 {print $0}' info2 > info3
awk 'match($0,"</svg>") == 0 {print $0}' temp.svg > mix.svg
# appending second svg after first one
cat info3 >> mix.svg
# remove temporary files
rm info
rm info2
rm info3
rm temp.svg
Examples with Clip arts taken from http://www.openclipart.org/