In message <t8a0ng$umi$
1...@dont-email.me> Michael F. Stemper <
michael...@gmail.com> wrote:
> On 13/06/2022 19.21, Lewis wrote:
>> In message <t88358$ad1$
1...@dont-email.me> Michael F. Stemper <
michael...@gmail.com> wrote:
>>> 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"
>>
>> So do that.
>>
>> $ MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill black -draw 'text 10,20 "$MYDATE"' RadarMap.png Stamped.png
> No error message is given. The text drawn on the image is:
> $MYDATE
Then it is still a quoting issue, probably beaus you hav single quotes
around the outside. I do not use the convert tool, so I can’t tell you
specifically what the issue is, but the first thing I wold do is
eliminate the single quotes, assuming they are not required by convert.
$ MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill black -draw "text 10,20 $MYDATE" RadarMap.png Stamped.png
or maybe
$ MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill black -draw "text 10,20 \"$MYDATE\"" RadarMap.png Stamped.png
Remember that ' and " ae very different, and ' do not usually allow
expansion of variables contained inside, but sometimes it is hard to
know when a variable is being expanded by the shell and when it is being
passed to the command.
Either way, sometimes you just have to play with the quotes and the
escapes.
--
Were it not for frustration and humiliation I suppose the human race
would get ideas above its station. -Ogden Nash