Re: Command substitution into argument to convert

Lewis <[email protected]> Tue, 14 Jun 2022 23:38:34 -0000 (UTC)
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Organization Miskatonic U
Message-ID <[email protected]>
In message <[email protected]> Lewis <[email protected]> wrote:
> $ MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill black -draw "text 10,20 \"$MYDATE\"" RadarMap.png Stamped.png

This works:

MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill white -draw "text 10,20 \"$MYDATE\"" image.jpg image-date.jpg

I expect this also works, but did not try:
convert -pointsize 20 -fill white -draw "text 10,20 \"$(date +"%m/%d %H:%M")\"" image.jpg image-date.jpg

This SHOULD work because the $() should protect the "" inside...

(of course, this draws white text no matter what, which is fine if the
image is dark, but invisible if the top left is white).

-- 
The "H" in Jesus H Christ comes from "Harold be Thy name" in the
	Lord's Prayer.