Sponsored Content
Top Forums UNIX for Dummies Questions & Answers What is the difference between pipe and filter? Post 9263 by doeboy on Wednesday 24th of October 2001 04:58:49 PM
Old 10-24-2001
A pipe (or "|") is used to redirect output to another command.
For example,

ls -la | more

Will pipe output to the more command letting view the directory listing one page at a time.

A redirector (">" or ">>" or "<" or "<<" normally tells where to output or take input from another file.

ls -la > filename

This will write the output of the ls command to a file called "filename".
 

10 More Discussions You Might Find Interesting

1. Programming

spam filter

hi I want to write a program that cathes spam mails. The program checks all the mails received by the server and deletes it if its subject contains one of the unwanted strings in a simple txt file. I am waiting for your suggestions (URL, tutorial, referance, library ,etc...). thanks... (2 Replies)
Discussion started by: fnoyan
2 Replies

2. UNIX for Dummies Questions & Answers

Filter results through pipe with grep

ls -ltr | grep string How can I use regular expressions to filter the results provided even more. I am using the above command as a reference. (1 Reply)
Discussion started by: ckandreou
1 Replies

3. Solaris

logger + filter

Hi, I have an application log file and I am redirecting it to syslog ...| logger -p user.err Howver, the size redirected is too arge and I am seeking a way to filter what to redirect to syslog. any mean to do this, knowing that I do not want to decrease the log level of the app? ... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

4. Shell Programming and Scripting

Replace pipe with Broken Pipe

Hi All , Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies

5. Shell Programming and Scripting

How to filter

Hi I have a file containing the below lines 1010001001639 1010001001789 1020001001927 1030001001928 1040001002033 1200001002609 1200001003481 1200001004935 I need to filter lines that starts with 101. It would be of great help if its in awk. (6 Replies)
Discussion started by: Naga06
6 Replies

6. Programming

difference bewteen pipe, xargs, and exec

I have read several docs on these on the web and looked at examples. I can't figure out the difference. In some cases you use one or the other or you combine them. can someone help me understand this? (1 Reply)
Discussion started by: guessingo
1 Replies

7. Programming

what is the main difference between difference between using nonatomic lseek and O_APPEND

I think both write at the end of the file ...... but is there a sharp difference between those 2 instruction ..... thank you this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies

8. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

9. UNIX for Dummies Questions & Answers

Filter records in a huge text file from a filter text file

Hi Folks, I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file. bash scripting is what i need. Data.txt Name OrderID Quantity Sam 123 300 Jay 342 498 Kev 78 2500 Sam 420 50 Vic 10... (3 Replies)
Discussion started by: tech_frk
3 Replies

10. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies
FBB::Pipe(3bobcat)						   Error handler						FBB::Pipe(3bobcat)

NAME
FBB::Pipe - Defines a system level pipe SYNOPSIS
#include <bobcat/pipe> Linking option: -lbobcat DESCRIPTION
FBB::Pipe objects may be used to construct a pipe. FBB::Pipe objects offer a simple interface to the reading and writing ends of pipes. FBB::Pipe objects are object-wrappers around the pipe(2) system call. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
- CONSTRUCTORS
o Pipe(): The default Pipe() constructor constructs a basic pipe, calling pipe(2). This constructor throws an Errno exception if the default Pipe constructor did not properly complete. The thrown Errno object's which() member shows the system's errno value set by the failing pipe(2) function. o Pipe(int const *fd): This constructor expects two file descriptors, which already define a pipe, stored at fd. Following the construction of the Pipe object the array at by fd is no longer used by the Pipe object. The copy constructor is available. Note that when the pipe goes out of scope, no close(2) operation is performed on the pipe's ends. If the pipe should be closed by the desc- tructor, derive a class from Pipe(3bobcat), whose destructor performs the required closing-operation. MEMBER FUNCTIONS
o int readFd() const: Returns the pipe's file descriptor that is used for reading o void readFrom(int filedescriptor): Sets up redirection from the internal read filedescriptor to the given filedescriptor: information is read from the FBB::Pipe object when reading from the provided filedescriptor. o void readFrom(int const *filedescriptors, size_t n): Sets up redirection from the internal read filedescriptor to the given filedescriptors: information is read from the FBB::Pipe object when reading from any of the n provided filedescriptors (experimental). o int readOnly(): Closes the writing end of the pipe, returns the reading end's file descriptor. o void verify() const: Obsoleted, will be removed in a future Bobcat release. o int writeFd() const: Returns the pipe's file descriptor that is used for writing o void writtenBy(int filedescriptor): Sets up redirection from the internal write filedescriptor to the given filedescriptor: information is written to the FBB::Pipe object when writing to the provided filedescriptor. o void writtenBy(int const *filedescriptors, size_t n): Sets up redirection from the internal write filedescriptor to the given filedescriptors: information is written to the FBB::Pipe object when writing to each of the n provided filedescriptors. o int writeOnly(): Closes the reading end of the pipe, returns the writing end's file descriptor. PROTECTED ENUMERATION
The RW protected enumeration has the following elements: o READ: The index in d_fd[] (see below) of the element holding the pipe's reading file descriptor; o WRITE: The index in d_fd[] (see below) of the element holding the pipe's writing file descriptor PROTECTED DATA
o int d_fd[2]: The array holding the pipe's file descriptors. The READ element contains the pipe's reading file descriptor, the WRITE element con- tains the pipe's writing file descriptor, EXAMPLE
#include <bobcat/pipe> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <iostream> #include <string> using namespace std; using namespace FBB; int main() { Pipe p; // construct a pipe cout << "Read file descriptor: " << p.getReadFd() << endl; cout << "Write file descriptor: " << p.getWriteFd() << endl; int pid = fork(); if (pid == -1) return 1; if (!pid) //child { p.readFrom(STDIN_FILENO); // read what goes into the pipe string s; getline(cin, s); cout << "CHILD: Got `" << s << "'" << endl; getline(cin, s); cout << "CHILD: Got `" << s << "'" << endl; return 0; } p.writtenBy(STDOUT_FILENO); // write to the pipe via cout cout << "first line" << endl; cout << "second line" << endl; waitpid(pid, 0, 0); return 0; } FILES
bobcat/pipe - defines the class interface SEE ALSO
bobcat(7), pipe(2), mkfifo(3) BUGS
Note that when the pipe goes out of scope, no close(2) operation is performed on the pipe's ends. If the pipe should be closed by the desc- tructor, derive a class from Pipe(3bobcat), whose destructor performs the required closing-operation. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::Pipe(3bobcat)
All times are GMT -4. The time now is 06:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy