Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Is the space actually 'magic' or it simply that you have no filenames that end with a space?
    • ssshh! That's part of the magic ;)

      From what I can see, that quite possibly is the reason.

  • That works until you have a file whose name ends with a space. Another way:

    (mkdir X; cd X; convert -background "#ffffff" -fill "#000000" -font Helvetica -pointsize 14 -size 400x caption:"*" ../your-file.png; cd ..; rmdir X)

    This uses the fact that in an empty directory, a globbed '*' is just a '*'.

    • Except I'd rather not have odd directories being created, especially if anything goes wrong. Plus it seems a lot more work than the "magic" space :)

  • Duh. Much simpler:

    convert -background "#ffffff" -fill "#000000" -font Helvetica -pointsize 14 -size 400x caption:"'*'" your-file.png

    The shell eats the double quotes, and convert gets the single quotes.

    • Or even:

      convert -background "#ffffff" -fill "#000000" -font Helvetica -pointsize 14 -size 400x caption:\"*\" your-file.png

      • As I mentioned, I did try all types of escaping and quoting. In your examples the images contain the 3 characters '*' and "*" respectively as the text. Infuriating! Even trying to fool it with the hex value doesn't work, it gets translated into an asterisk, then 'convert' does the filename expansion on it!