@@ -177,15 +177,27 @@ sub unix_execute {
177177 } else {
178178 $cmd = ' sudo ' if (defined ($options {sudo }));
179179 $cmd .= $options {command_path } . ' /' if (defined ($options {command_path }));
180- $cmd .= $options {command } . ' ' if (defined ($options {command }));
181- $cmd .= $options {command_options } if (defined ($options {command_options }));
182-
183- ($lerror , $stdout , $exit_code ) = backtick(
184- command => $cmd ,
185- timeout => $options {options }-> {timeout },
186- wait_exit => $wait_exit ,
187- redirect_stderr => $redirect_stderr
188- );
180+ $cmd .= $options {command } if (defined ($options {command }));
181+ $cmd .= ' ' . $options {command_options } if (defined ($options {command_options }));
182+
183+ if (defined ($options {no_shell_interpretation }) and $options {no_shell_interpretation } ne ' ' ) {
184+ my @args = split (' ' ,$cmd );
185+ ($lerror , $stdout , $exit_code ) = backtick(
186+ command => $args [0],
187+ arguments => [@args [1.. $#args ]],
188+ timeout => $options {options }-> {timeout },
189+ wait_exit => $wait_exit ,
190+ redirect_stderr => $redirect_stderr
191+ );
192+ }
193+ else {
194+ ($lerror , $stdout , $exit_code ) = backtick(
195+ command => $cmd ,
196+ timeout => $options {options }-> {timeout },
197+ wait_exit => $wait_exit ,
198+ redirect_stderr => $redirect_stderr
199+ );
200+ }
189201 }
190202
191203 if (defined ($options {options }-> {show_output }) &&
@@ -863,6 +875,15 @@ Executes a command on Unix and returns the output.
863875
864876=item * C<timeout > - Timeout for the command execution.
865877
878+ =item * C<wait_exit > - bool.
879+
880+ =item * C<redirect_stderr > - bool.
881+
882+ =item * C<sudo > - bool prepend sudo to the command executed.
883+
884+ =item * C<no_shell_interpretation > - bool don't use sh interpolation on command executed
885+
886+
866887=back
867888
868889=back
0 commit comments