[kw-pm] trying to diff two files which contain '$' in their names

Robert P. J. Day rpjday at crashcourse.ca
Wed Mar 16 04:29:49 PDT 2011


  as a followup to my earlier post, here's what appears to be a
solution to what i was after:

$pre1 = '$file';
$post1 = ' 1';
$pre2 = '$file';
$post2 = ' 2';

$res = `diff \'${pre1}\'@@\'${post1}\' \'${pre2}\'@@\'${post2}\'`;
print $res, "\n";

  it was clarified for me that the two files to be diff'ed had names
of the format:

  1) some arbitrary string
  2) two literal '@' characters
  3) another arbitrary string

and all of those strings could conceivably have embedded whitespace or
literal dollar signs.  argh.  who the $%#^&^&% thought that was a sane
idea?

  in any event, you can see how i whipped up a test program that
simulated that, and protected everything inside the backticks with
escaped single quotes, which appears to work.

  thoughts?

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the kw-pm mailing list