Thread: Redirect stdin to stdout - Pipe

  1. #1
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187

    Redirect stdin to stdout - Pipe

    Hello guys,

    my input on the terminal should be something like this :

    Code:
    ./mapreduce du "wc -l"
    In which du is the map argument and "wc -l" is reduce's argument.

    I've already completed my map but now I need to redirect my map's stdout to reduce's "wc -l" stdin.

    Is this possible ?

    Thanks.

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    the popen function might do what you want.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> I need to redirect ... stdout to ... "wc -l" stdin.
    Code:
    ./mapreduce du | wc -l
    That pipes the output of mapreduce to wc's input.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. redirect STDOUT to pipes
    By Drogin in forum Linux Programming
    Replies: 2
    Last Post: 03-24-2011, 01:56 PM
  2. Redirect stdout using dup
    By spank in forum Linux Programming
    Replies: 13
    Last Post: 04-03-2008, 05:16 PM
  3. Redirect stdout
    By GoLuM83 in forum C Programming
    Replies: 6
    Last Post: 12-15-2006, 04:17 PM
  4. redirect stdout to editbox
    By kerm1t in forum Windows Programming
    Replies: 1
    Last Post: 05-11-2005, 10:32 PM
  5. Redirect stdout?
    By Imperito in forum C++ Programming
    Replies: 2
    Last Post: 05-11-2002, 03:43 PM