in reply to Re^2: 255: perl compilation error code and ssh cannot connect code (updated)
in thread 255: perl compilation error code and ssh cannot connect code

Maybe good idea only change the result if it is executed via ssh:
#!/usr/bin/env perl use warnings; use strict; END { $?=254 if defined $ENV{SSH_CONNECTION} and $? eq 255 } print $c;
  • Comment on Re^3: 255: perl compilation error code and ssh cannot connect code (updated)
  • Download Code

Replies are listed 'Best First'.
Re^4: 255: perl compilation error code and ssh cannot connect code (updated)
by haukex (Archbishop) on Nov 02, 2016 at 13:42 UTC

    Hi i5513,

    Maybe good idea only change the result if it is executed via ssh

    Sure, I'd say that's a good idea. Just a minor nitpick, personally I'd test an environment variable for truth instead of definedness, since that allows me to do ENVVAR=0 to disable it, and I'd use == (numeric) instead of eq (string) comparisons: $?=254 if $ENV{SSH_CONNECTION} && $?==255;

    Regards,
    -- Hauke D