in reply to Re^8: Cpan install gets stuck installing Net OpenSSH ?
in thread Cpan install gets stuck installing Net OpenSSH ?

Here I put some prints inside the 'try_shell' sub:
sub try_shell { my $shell = shift; print "line 1\n"; my $out = eval { capture($shell, '-c', 'echo good') }; print "line 2\n"; if ($out and $out =~ /^good$/) { print "line 3\n"; if ($shell =~ /ksh/) { print "line 4\n"; if (defined (my $version = eval { `$shell --version 2>&1` +})) { print "line 5\n"; if ($version =~ /version\s+sh\s+\(AT\&T\s+Research\)/) + { diag "skipping tests for broken AT&T ksh shell!"; return undef; } } } print "line 6\n"; if ($shell eq '!!fish') { diag "TODO: add support for fish shell!"; return undef; } return 1; } return undef; }
This is the result:
-bash-3.2$ sudo perl -Mblib t/quoting.t line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 4 ^C
I think it makes it through the first 4 shells then gets stuck on the 5th. I think ksh is the 5th one based on the line that calls the sub:
my @shells = grep try_shell($_), qw(sh csh bash tcsh ksh dash ash pdks +h mksh zsh fish);

Replies are listed 'Best First'.
Re^10: Cpan install gets stuck installing Net OpenSSH ?
by salva (Canon) on Mar 15, 2016 at 18:25 UTC
    Ah, it seems that the command hanging is ksh --version.

    Until now, all the shells I have checked printed its version or just thrown an error when called with that argument, but it seems you have found one behaving differently.

    Could you give us a bit more detail about your operating system vendor and version, and if possible about the ksh available there?

      SunOS servername 5.10 Generic_150400-11 sun4u sparc SUNW,SPARC-Enterprise

      I'm not entirely sure how to tell what version of KSH I have. "ksh --version" does nothing. "echo ${.sh.version}" gives an error. "echo $KSH_VERSION" does nothing.

      Is there a way I can fix my KSH so it responds? Or, alternatively, get the Net::OpenSSH install to not attempt to run quoting.t ?
        You can just ignore the failing test. It is harmless.