Rex

 view release on metacpan or  search on metacpan

lib/Rex/Interface/Shell/Csh.pm  view on Meta::CPAN

}

# sub set_env {
#   my ( $self, $env ) = @_;
#   my $cmd = undef;
#
#   die("Error: env must be a hash")
#     if ( ref $env ne "HASH" );
#
#   while ( my ( $k, $v ) = each($env) ) {
#     $cmd .= "setenv $k \"$v\"; ";
#     $self->{env_raw} .= "$k $v";
#   }
#
#   $self->{env} = $cmd;
# }

sub exec {
  my ( $self, $cmd, $option ) = @_;

  if ( exists $option->{path} ) {

lib/Rex/Interface/Shell/Csh.pm  view on Meta::CPAN


  if ( $self->{source_global_profile} ) {
    $complete_cmd = "source /etc/profile >& /dev/null ; $complete_cmd";
  }

  if ( exists $self->{__env__} ) {
    if ( ref $self->{__env__} eq "HASH" ) {
      for my $key ( keys %{ $self->{__env__} } ) {
        my $val = $self->{__env__}->{$key};
        $val =~ s/"/"'"'"/gms;
        $complete_cmd = " setenv $key \"$val\" ; $complete_cmd ";
      }
    }
    else {
      $complete_cmd = $self->{__env__} . " $complete_cmd ";
    }
  }

# this is due to a strange behaviour with Net::SSH2 / libssh2
# it may occur when you run rex inside a kvm virtualized host connecting to another virtualized vm on the same hardware
  if ( Rex::Config->get_sleep_hack ) {



( run in 0.385 second using v1.01-cache-2.11-cpan-a1d94b6210f )