Problems in console application lazarus / 32-Linux ---------------------------------------------------------------------- emersonldc · 2018-03-22 19:49 I need to create a console application that runs a command and get the return from command and save it to a variable. Can someone help me? Below is the code I have made so far. procedure TSDKMonitor.DoRun; Var   cmd: TProcess;   Result: string; begin   try     cmd := Tprocess.create(self);     cmd.commandLine := 'ls -la';     cmd.Execute;   Finally     cmd.free;   end; end; ---------------------------------------------------------------------- balazsszekely · 2018-03-22 20:31 QuoteCan someone help me?Yes. http://wiki.freepascal.org/Executing_External_Programs ---------------------------------------------------------------------- emersonldc · 2018-03-22 20:55 I even read this article, but I could not retrieve the information. ---------------------------------------------------------------------- benohb · 2018-03-22 22:36 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TSDKMonitor.DoRun;Var  cmd: TProcess;  Result: string;  AStringList: TStringList;  begin  try    cmd := Tprocess.create(self);    cmd.commandLine := 'ls -la';    cmd.Options := cmd.Options + [poWaitOnExit, poUsePipes];    cmd.Execute;    AStringList := TStringList.Create;    AStringList.LoadFromStream(cmd.Output);  Finally    cmd.free;  end;    writeln(AStringList[0]); // first file/ first variable  writeln(AStringList[1]); //  AStringList.Free;end; ---------------------------------------------------------------------- emersonldc · 2018-03-23 12:38 Perfect, it worked the way I needed it. Thanks a lot for the help!