Help for this page

Select Code to Download


  1. or download this
    $ echo Hello >t1.txt
    
    $ echo World >t2.txt
    ...
    $ perl -MIPC::System::Simple=system -wle " $ret = system q[diff -u t1.
    +txt t2.txt >NUL 2>&1] ; print $ret; print $?"
    "diff -u t1.txt t2.txt >NUL 2>&1" unexpectedly returned exit value 1 a
    +t -e line 1
    
  2. or download this
    $ diff --help |grep -i exit
    Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
    
  3. or download this
    $ perl -MIPC::System::Simple=system -wle " $ret = system [0,1], q[diff
    + -u t1.txt t2.txt >NUL 2>&1] ; print $ret; print $?"
    1
    ...
    $ perl -Mautodie=system -wle " $ret = system [0,1], q[diff -u t1.txt t
    +2.txt >NUL 2>&1] ; print $ret; print $?"
    1
    256