I am using Qt 5.0.1 (64 bit) in ubuntu. I am running the following command under button pressed function.
QString command = "sh /home/rahul/qtapp/ques_new/ques_new/inter4ql/test1.sh"; const char* command2;
command2 = command.toLocal8Bit().data();
system(command2);
test1.sh file content is
!/bin/bash
echo "hello" echo "hello" >> out.txt
While calling this system command by pressing button, it shows hello in the output window, but it doesnot create new file out.txt.
For debugging I manually create out.txt before calling this function. But, after calling this function again it shows hello on output window but doesnot put hello in out.txt.