package Psh
::Strategy
::Executable
;
This strategy will search for an executable file and execute it
@Psh::Strategy
::Executable
::ISA
=('Psh::Strategy');
return Psh
::Strategy
::CONSUME_TOKENS
;
my $executable= Psh
::Util
::which
($com);
return $executable if defined $executable;
if (Psh
::Options
::get_option
('expansion') and
(!$Psh::current_options
or !$Psh::current_options
->{noexpand
})) {
@words= Psh
::PerlEval
::variable_expansion
(\
@words);
if (Psh
::Options
::get_option
('globbing') and
(!$Psh::current_options
or !$Psh::current_options
->{noglob
})) {
@words = Psh
::Parser
::glob_expansion
(\
@words);
@words = map { Psh
::Parser
::unquote
($_)} @words;
return (1,join(' ',$executable,@words),[$executable,$tmp,@words], 0, undef, );