Re: using pipes with g_spawn_command_line_sync
- From: Luka Napotnik <luka napotnik gmail com>
- To: gtk-app-devel-list gnome org
- Subject: Re: using pipes with g_spawn_command_line_sync
- Date: Wed, 23 Aug 2006 22:33:58 +0200
I expected "1" but got the command itself. And when appending /bin/sh at
start, the returned status is != 0 and the output is blank (empty
string).
On sre, 2006-08-23 at 16:08 -0400, Tristan Van Berkom wrote:
Luka Napotnik wrote:
Hello.
I am unable to run a command with g_spawn_command_line_sync() that uses
pipes. For example "echo \"bla\" | wc -l" gives the exact output as the
command insted "1". Other commands without the pipe execute with no
problem. What's the problem?
I'm afraid that this doesnt make sence:
gives the exact output as the command insted "1"
are you saying that it is outputting "1" when you expected something else ?
otherwise - what is it outputting exactly instead ?
If it is indeed broken and you're not getting the desired "1" that one
would expect... you might try prepending the interpreter to that line
like so: "/bin/sh echo \"bla\" | wc -l"
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]