Page 1 of 1

$ sign on text not rendering if followed by numbers

Posted: 2012-10-27T19:46:33-07:00
by javismiles
hi, i have noticed that if in a text i have the $ sign followed by a number it doesn't render,
anybody else with this problem? what should i do if i need to render something like $15 , $10 in text?
if $ is by itself is not prob, prob happens if its followed by numbers
thanks a lot
Jav

Re: $ sign on text not rendering if followed by numbers

Posted: 2012-10-27T20:23:49-07:00
by fmw42
try escaping the $. on unix \$ not sure about windows. or put quotes about the string

see
http://www.imagemagick.org/Usage/text/#escape_chars

perhaps see if anything about that on Windows at http://www.imagemagick.org/Usage/windows/

Re: $ sign on text not rendering if followed by numbers

Posted: 2012-10-28T15:40:17-07:00
by snibgo
I suspect a Unix escape issue. No problem in Windows, eg:

convert logo: -gravity south -annotate 0 $1billion t.png

Re: $ sign on text not rendering if followed by numbers

Posted: 2012-10-28T17:06:05-07:00
by fmw42
javismiles wrote:hi, i have noticed that if in a text i have the $ sign followed by a number it doesn't render,
anybody else with this problem? what should i do if i need to render something like $15 , $10 in text?
if $ is by itself is not prob, prob happens if its followed by numbers
thanks a lot
Jav
What is the exact command line? Are you talking about $ in the text string you want to add or $ in the input filename or $ in the output filename?

What version of IM? What platform?

Re: $ sign on text not rendering if followed by numbers

Posted: 2012-12-04T19:09:24-07:00
by anthony
snibgo wrote:I suspect a Unix escape issue. No problem in Windows, eg:

convert logo: -gravity south -annotate 0 $1billion t.png

$1 outside of single quotes is a shell variable substitution. As that variable is probably not defined it gets replaced by a empty string by the shell. In a script $1 is the first argument given to teh shell script. This is not a IM problem but a Shell problem (CLI) problem.

a $ on its own (followed by a space) is not reconised as a variable by the shell so the shell leaves it alone.

Example ('#' is the CLI shell prompt')

Code: Select all

  # echo $123
  23
  # echo $
  $
  # echo $something

  #
DOS often uses % instead of $ for its variable substitutions so the problem does not appear there.

In summery use single quotes or a backslash.