call external program with pipe