[Solved]: TProcess in Linux lazarus / 32-Linux ---------------------------------------------------------------------- gilsonalencar · 2013-10-17 11:43 Hi, In my Linux application I'm trying to use Tprocess to execute a specific command line. However, TProcess not recognize  special characters as “|”. I'm trying to do this: command:=TProcess.Create(nil); command.Executable:='dmesg'; command.Parameters.DelimitedText:='| grep tty -i'; command.Execute; Any sugestion? ---------------------------------------------------------------------- BigChimp · 2013-10-17 11:51 Read the wiki article on executing external processes. TProcess is not a shell and does not recognize | > < & etc. You can work around it by calling the shell e.g. bash -c .... something IIRC. See the article. ---------------------------------------------------------------------- gilsonalencar · 2013-10-17 12:19 Works fine in this way: command:=TProcess.Create(nil); command.CommandLine:='sh -c "dmesg | grep tty -USB" '; command.Execute; But, TProcess.CommandLine is deprecated. "TProcess is not a shell, so it does not allow i/o redirection, pipelining, etc." see this: http://forum.lazarus.freepascal.org/index.php/topic,13363.msg69804.htm l#msg69804 ---------------------------------------------------------------------- BigChimp · 2013-10-17 12:29 So you should officially use parameters.... in which you can put the same content... but formatted differently... ---------------------------------------------------------------------- gilsonalencar · 2013-10-17 12:43 Final solution: command:=TProcess.Create(nil); command.Executable:='sh'; commnad.Parameters.DelimitedText:='-c "dmesg | grep tty -i" '; command.Execute; works fine. ---------------------------------------------------------------------- marcov · 2013-10-17 14:23 Quote from: gilsonalencar on October 17, 2013, 02:43:51 pmFinal solution: command:=TProcess.Create(nil); command.Executable:='sh'; commnad.Parameters.DelimitedText:='-c "dmesg | grep tty -i" '; command.Execute; works fine. But command.parameters.add('-c'); command.parameters.add('dmesg | grep tty -i'); would be more correct I guess.