TShell.Execute#
Executa o comando usando o profile e as opções configuradas e devolve um TProcessResult.
Declaração#
function Execute(): TProcessResult;Exemplo#
program Exemplo;
uses Odisseia.Process;
var
Shell: TShell;
Result: TProcessResult;
begin
Shell := TShell.Create;
Shell.Executable := Config.GetString('SHELL_EXECUTABLE');
Shell.Command := 'echo hello';
Result := Shell.Execute;
WriteLn(Result.Output);
end.Exige shell.execute. Falhas do host são sanitizadas; timeout gera ETimeoutError, e código não zero pode gerar exceção conforme RaiseOnNonZeroExit.