Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

funnel(1) [debian man page]

funnel(1)							     logtools								 funnel(1)

funnel - split one pipe stream to one or more files or programs SYNOPSIS
funnel [|] [>[>]file] [|process] DESCRIPTION
The funnel program will read data from standard input and write it to several output streams. The | symbol means to copy standard input to standard output. The > symbol means that a file name immediately follows with no separating spaces, the file will be truncated if it exists or created if it doesn't. The >> means that the file is to be appended to if it exists. A | symbol followed immediately by text indicates a command that is to be run by system() and will have all input piped to it. EXIT STATUS
0 No errors 1 Error opening input Other errors are 100 + number of commands or files that fail AUTHOR
This program, its manual page, and the Debian package were written by Russell Coker <>. FEATURES
Uses popen (3) for output so that shell expansion gets performed. If you want such shell expansion then you must ensure that you quote the parameters correctly so that they get expanded by popen (3) not the shell that calls funnel. SEE ALSO
popen(3) Russell Coker <;> 0.06 funnel(1)

Check Out this Related Man Page

popen(3)						     Library Functions Manual							  popen(3)

       popen, pclose - initiate I/O to/from a process

       #include <stdio.h>

       FILE *popen(command, type)
       char *command, *type;

       FILE *stream;

       The arguments to are pointers to null-terminated strings containing respectively a shell command line and an I/O mode, either "r" for read-
       ing or "w" for writing.	It creates a pipe between the calling process and the command to be executed.  The  value  returned  is  a  stream
       pointer that can be used (as appropriate) to write to the standard input of the command or read from its standard output.

       A stream opened by should be closed by which waits for the associated process to terminate and returns the exit status of the command.

       Because open files are shared, a type "r" command may be used as an input filter, and a type "w" as an output filter.

       The routine returns a null pointer if files or processes cannot be created, or the shell cannot be accessed.

       The routine returns -1 if stream is not associated with a `popened' command.

       Buffered reading before opening an input filter may leave the standard input of that filter mispositioned.  Similar problems with an output
       filter may be forestalled by careful buffer flushing, for instance, with For further information, see

       The routine always calls and never calls

See Also
       sh(1), pipe(2), wait(2), system(3), fclose(3s), fopen(3s)

Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

permanent redirection of standard input

while running a user inter-active program how can we get the commands from a file instead of the user? is there anyway to permanently redirect content of a file to standard input? (6 Replies)
Discussion started by: gfhgfnhhn
6 Replies

2. Shell Programming and Scripting

remove verticalbar or pipe symbol

hi guys i have 6000 rows column the text in the column has the symbol vertical bar |. i tried some of the commands to remove it but none of the commands are reconzng this symbol. would u plz help to remove this symbol from the text with any kind of unix command u r help would be appreciated ... (9 Replies)
Discussion started by: bogu0001
9 Replies

3. Shell Programming and Scripting

Perl : I \ O

Hello Forum, first thanks indvance. I am trying to read a text file then write it to another file. I am getting these errors: Global symbol "$line" requires explicit package name at ./ line 29. Global symbol "$line" requires explicit package name at ./ line 31.... (7 Replies)
Discussion started by: rawmaterial
7 Replies

4. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

5. Shell Programming and Scripting

How to cut a line with the delimeter "pipe symbol"

Hi I am unable to cut a line with the delimeter as a pipe symbol "|" COuld you please help me ? below is the code i am using right now ************ for i in `cat xyz` do source=`echo $i | cut -f 1 -d |` echo $source done ********* Error i am recieving while exceuting the above... (7 Replies)
Discussion started by: Tasha_T
7 Replies

6. Shell Programming and Scripting

how to redirect multiple input files?

I have a program that runs like "cat f1 - f2 -", I need to write shell script to run the program whose standard input will be redirected from 2 files. I spend a whole day on it, but didn't figure out. Can someone help me out? Thanks! (8 Replies)
Discussion started by: microstarwwx
8 Replies

7. Shell Programming and Scripting

ordering a data file

With an input file like this: How can I get an output like this? (In the quoted examples, the "_" sign represents an empty space) Note that there are some minus signs and no spaces, in the example above the first character of the first line is an empty space, so each number spans 10... (16 Replies)
Discussion started by: lego
16 Replies

8. Shell Programming and Scripting

Need help with awk

Hi Guys, Need your help to optimized the script I have a file which have data like this $ cat /auto/atsingh5/outtest PFLAG -------------------------- ----- ----------- 2011-06-16- 5 2050 2011-06-16- 9 2372... (9 Replies)
Discussion started by: atul9806
9 Replies

9. Shell Programming and Scripting

Reading from standard input

So, I am new to shell scripting and have a few problems. I know how to read from standard input but I do not know how to really compare it to say, a character. I am trying to compare it to a character and anything exceeding just a character, the user will get an output message, but the program... (7 Replies)
Discussion started by: Bungkai
7 Replies

10. Shell Programming and Scripting

Help with concatinating the data of 2 files

Hi All, I am trying to merge to 2 files 348.csv & 349.csv using join,awk commands but not getting proper output: cat 348.csv Timestamp Server 348 02/04/2013 09:19 100 02/04/2013 09:20 250 02/04/2013 09:21 80 cat... (9 Replies)
Discussion started by: ss_ss
9 Replies

11. Shell Programming and Scripting

Use the content of a file as standard input

I want to use a content of a file as standard input to a program and dump the output to a file. However, when I try the following code: ./program < > output.out The output.out is empty. So, how can I handle this problem? Thanks in advance! (11 Replies)
Discussion started by: Ray Sun
11 Replies

12. UNIX for Dummies Questions & Answers

Ps -ef, output getting truncated, please help

Hi All, here is an output of my command and the problem is that my output string is truncated, I want to exact the full string, I am on BASH shell, please help me out. Regards Rahul command with Output : lonss05903:cmdsvc01 /home/cmdsvc01 > ps -aef|grep 'Copy' cmdsvc01 2642 8675 ... (7 Replies)
Discussion started by: rahulkalra9
7 Replies

13. Shell Programming and Scripting

Remove pipe(|) symbol in except the ones which are enclosed in double quotes

I have file with are delimited by pipe(|) symbol, I wanted those to be removed except the ones which are enclosed in double quotes. If your quote file is: |Life is |Beautiful"|"Indeed life |is beautiful too|"|"But unix is fun| is not"|" It should return: Life is Beautiful"|"Indeed life is... (9 Replies)
Discussion started by: Sathyapts
9 Replies

14. Shell Programming and Scripting

Bash expansion

Hello. I cannot write a command without using eval. Any help is welcome Note 1 : What does the function SOMETHING has no importance. Note 2 : What does the command find has no importance. It is an expansion variable problem : where to put or or or anythings else What works (FILTRE_1... (8 Replies)
Discussion started by: jcdole
8 Replies

15. Shell Programming and Scripting

Loop help

Hi friends, I have a program below where I need to input keyspace name so that program executing correctly, but I want to pass multiple values in keyspace in same time so that in single go, it should complete all keyspaces names that I pass to program. #!/bin/bash keyspace=$1... (8 Replies)
Discussion started by: onenessboy
8 Replies

Featured Tech Videos