Re: Using pipes with g_spawn_command_line_sync



Dear all,

I'm trying to execute a system command using g_spawn_command_line_sync.
When the system command contains no pipes all is well. However, when the
command contains pipes, for example:

g_spawn_command_line_sync("xwininfo -tree -root | grep \"Mesh Viewer
\"",&standard_out,&standard_err,&exit_stat,&error);

everything falls to pieces and the command isn't interpreted properly
(the output I get on stderr is "usage:  xwininfo [-options ...]\n\nwhere
options include:\n    -help", ' ' <repeats 16 times>, "print this
message\n    -display host:dpy    X server to contact\n    -root", ' '
<repeats 16 times>, "use the root window\n    -id wi"..."

Can anyone help? Am I using g_spawn_command_line_sync the wrong way? Is
it not intended to work with pipes?

Thanks, Tim





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]