18 lines
757 B
Bash
Executable File
18 lines
757 B
Bash
Executable File
#!/usr/bin/env bash
|
||
# usage: ./make-svg.sh 123 → creates 123.svg in the current directory
|
||
|
||
NUM=$1 # the number (or any text) you want inside the SVG
|
||
OUT="${NUM}.svg" # name the file after the number (change if you wish)
|
||
|
||
# --- 1️⃣ Write the SVG XML directly ------------------------------------------------
|
||
printf '%s\n' \
|
||
'<?xml version="1.0" encoding="UTF-8"?>' \
|
||
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="100">' \
|
||
' <style>text{font-family:Arial,Helvetica,sans-serif; font-size:48px; fill:#fff;}</style>' \
|
||
' <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle">' \
|
||
"$NUM" \
|
||
' </text>' \
|
||
'</svg>' > "$OUT"
|
||
|
||
echo "✅ SVG written to $OUT"
|