You can instead try using the popen command instead of system command. This allows you to either have a pipe as input to the process or a pipe as output from the process.
I have a quick and dirty Sketch that allows me to do one line commands from an Arduino terminal window and have the results piped back that I display in the terminal window.
The code for it is in the thread: https://communities.intel.com/message/265426#265426
Why not having a Linux process communicating with the sketch? I wrote a blog on efficient ipc between an Arduino sketch and a Linux process. Maybe useful as a starter in this context?
Thanks, I'll give pipe a try.