/usr/share/perl5/auto/Term/ReadLine/Zoid/ViCommand/shell.al is in libterm-readline-zoid-perl 0.07-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # NOTE: Derived from lib/Term/ReadLine/Zoid/ViCommand.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Term::ReadLine::Zoid::ViCommand;
#line 1058 "lib/Term/ReadLine/Zoid/ViCommand.pm (autosplit into blib/lib/auto/Term/ReadLine/Zoid/ViCommand/shell.al)"
sub shell {
my ($self, $string) = @_;
my ($fh, $file);
if ($string =~ /(?<!\\)%/) {
eval 'require File::Temp' || return $self->bell;
($fh, $file) = File::Temp::tempfile('PERL_RL_Zoid_XXXXX', DIR => File::Spec->tmpdir);
print $fh join "\n", @{$$self{lines}};
close $fh;
$string =~ s/(\\)\%|\%/$1 ? '%' : $file/ge;
}
#print STDERR "system: $string\n";
print { $$self{OUT} } "\n";
my $error = (exists $$self{config}{shell})
? $$self{config}{shell}->($string) : system( $string ) ;
if ($error) { printf { $$self{OUT} } "\nshell returned %s\n\n", $error >> 8 }
elsif ($file) {
open TMP, $file or return $self->bell;
@{$$self{lines}} = map {chomp; $_} (<TMP>);
close TMP;
$$self{pos} = [ length($$self{lines}[-1]), $#{$$self{lines}} ];
}
$$self{_buffer} = 0;
unlink $file if $file;
return 1;
}
# end of Term::ReadLine::Zoid::ViCommand::shell
1;
|