#include <boost/process.hpp> 
#include <boost/assign/list_of.hpp> 
#include <string> 
#include <vector> 
#include <iostream> 

using namespace boost::process; 

int main() 
{ 
  context ctx; 
  ctx.environment = self::get_environment(); 
  std::vector<pipeline_entry> entries; 
  std::vector<std::string> args = boost::assign::list_of("ls")("-l")("/"); 
  entries.push_back(pipeline_entry(find_executable_in_path("ls"), args, ctx)); 
  ctx.stdout_behavior = inherit_stream(); 
  args = boost::assign::list_of("grep")("bin"); 
  entries.push_back(pipeline_entry(find_executable_in_path("grep"), args, ctx)); 
  children cs = launch_pipeline(entries); 
  status s = wait_children(cs); 
  if (s.exited()) 
    std::cout << s.exit_status() << std::endl; 
} 