Code:
Code: Select all
#!/bin/bash
# this check is just an example of usage
if [ 1 -eq 1 ]; then
text="-draw \"fill #ffffff text 0,9 'Hello world!'\""
else
text=""
fi
echo $text
echo '= = ='
convert logo: $text -verbose result.png
echo '= = ='
convert logo: "$text" -verbose result.png
echo '= = ='
convert logo: -draw "fill #ffffff text 0,9 'Hello world!'" -verbose result.png
echo '= = ='
What am I doing wrong?-draw "fill #ffffff text 0,9 'Hello world!'"
= = =
logo:=>result.png GIF 640x480 640x480+0+0 8-bit sRGB 67.2KB 0.000u 0:00.000
convert: unable to open image `#ffffff': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: unable to open image `text': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: unable to open image `0,9': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: unable to open image `'Hello': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: unable to open image `world!'"': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
= = =
convert: unrecognized option `-draw "fill #ffffff text 0,9 'Hello world!'"' @ error/convert.c/ConvertImageCommand/1382.
= = =
logo:=>result.png GIF 640x480 640x480+0+0 8-bit sRGB 72.8KB 0.000u 0:00.000
= = =
I suppose it maybe just a bad bash code. I'm no familar with bash, so beforehand sorry for a possible offtopic.