Command substitution into argument to convert

"Michael F. Stemper" <[email protected]>
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Organization A noiseless patient Spider
Message-ID <[email protected]>
I'm trying to time-stamp image files as they're downloaded. The
following works fine:

$ convert -pointsize 20 -fill black -draw 'text 10,20 "06/13 14:13"' RadarMap.png Stamped.png

However, hard-coding the time stamp would make it worthless. What
I really want to use is the output of:

$ date +"%m/%d %H:%M"

But no matter how I try to incorporate that into the command, I
get errors.

For instance,

$ convert -pointsize 20 -fill black -draw 'text 10,20 $(date +"%m/%d %H:%M")' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `(' @ error/draw.c/DrawImage/3190.

or:

$ convert -pointsize 20 -fill black -draw "text 10,20 $(date +"%m/%d %H:%M")" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.

I've even tried two steps, initializing a variable and using it:

$ ts=$(date +"%m/%d %H:%M")
$ echo $ts
06/13 14:24
$ convert -pointsize 20 -fill black -draw "text 10,20 $ts" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.
$ convert -pointsize 20 -fill black -draw 'text 10,20 $ts' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `ts' @ error/draw.c/DrawImage/3190.

I'm sure that what I need to do to get a dynamic argument into
convert will be obvious to everybody except me. What am I missing?

Thanks,
-- 
Michael F. Stemper
Deuteronomy 24:17
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.