<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using bash with QProcess]]></title><description><![CDATA[<p dir="auto">Does anyone used QProcess to run bash?<br />
How can i exit the bash process?<br />
I tries bashProcess-&gt;write("exit\n\r") but it does'nt seems to work</p>
]]></description><link>https://forum.qt.io/topic/7495/using-bash-with-qprocess</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 07:30:19 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/7495.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Jul 2011 14:02:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using bash with QProcess on Mon, 11 Jul 2011 14:41:54 GMT]]></title><description><![CDATA[<p dir="auto">Thanks!!!</p>
]]></description><link>https://forum.qt.io/post/97344</link><guid isPermaLink="true">https://forum.qt.io/post/97344</guid><dc:creator><![CDATA[aabc]]></dc:creator><pubDate>Mon, 11 Jul 2011 14:41:54 GMT</pubDate></item><item><title><![CDATA[Reply to Using bash with QProcess on Mon, 11 Jul 2011 14:41:01 GMT]]></title><description><![CDATA[<p dir="auto">Try removing the '\r' at the end of your lines, only '\n' is needed on linux/unix.</p>
<p dir="auto">And with that particular code, you could avoid using an intermediate file, by getting the output directly from QProcess:<br />
@QProcess* process = new QProcess();<br />
process-&gt;start("route");<br />
process-&gt;waitForFinished();<br />
QString output =  process-&gt;readAll();@</p>
]]></description><link>https://forum.qt.io/post/97342</link><guid isPermaLink="true">https://forum.qt.io/post/97342</guid><dc:creator><![CDATA[alexisdm]]></dc:creator><pubDate>Mon, 11 Jul 2011 14:41:01 GMT</pubDate></item><item><title><![CDATA[Reply to Using bash with QProcess on Mon, 11 Jul 2011 14:18:36 GMT]]></title><description><![CDATA[<p dir="auto">I explain it again<br />
My code is:<br />
@<br />
QProcess* process = new QProcess();<br />
process-&gt;start("bash");<br />
process-&gt;waitForStarted();<br />
process-&gt;write("route &gt; /home/abc/aaa.txt\n\r");<br />
process-&gt;write("exit\n\r");<br />
process-&gt;waitForFinished();<br />
@</p>
<p dir="auto">For some reason - the process does not end after the "process-&gt;write("exit\n\r");"  and the last line does not get called ?<br />
Any ideas?</p>
]]></description><link>https://forum.qt.io/post/97337</link><guid isPermaLink="true">https://forum.qt.io/post/97337</guid><dc:creator><![CDATA[aabc]]></dc:creator><pubDate>Mon, 11 Jul 2011 14:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Using bash with QProcess on Mon, 11 Jul 2011 14:15:06 GMT]]></title><description><![CDATA[<p dir="auto">hi aabc ,<br />
I found this in the QProcess Class Reference :<br />
@<br />
The finished() signal provides the exit code and exit status of the process as arguments, and you can also call exitCode() to obtain the exit code of the last process that finished, and exitStatus() to obtain its exit status. If an error occurs at any point in time, QProcess will emit the error() signal. You can also call error() to find the type of error that occurred last, and state() to find the current process state.@</p>
]]></description><link>https://forum.qt.io/post/97335</link><guid isPermaLink="true">https://forum.qt.io/post/97335</guid><dc:creator><![CDATA[saidiahd]]></dc:creator><pubDate>Mon, 11 Jul 2011 14:15:06 GMT</pubDate></item></channel></rss>