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
PIPE(2) 							System Calls Manual							   PIPE(2)

NAME
pipe - create an interprocess communication channel SYNOPSIS
#include <unistd.h> int pipe(int fildes[2]) DESCRIPTION
The pipe system call creates an I/O mechanism called a pipe. The file descriptors returned can be used in read and write operations. When the pipe is written using the descriptor fildes[1] up to PIPE_MAX bytes of data are buffered before the writing process is suspended. A read using the descriptor fildes[0] will pick up the data. PIPE_MAX equals 7168 under Minix, but note that most systems use 4096. It is assumed that after the pipe has been set up, two (or more) cooperating processes (created by subsequent fork calls) will pass data through the pipe with read and write calls. The shell has a syntax to set up a linear array of processes connected by pipes. Read calls on an empty pipe (no buffered data) with only one end (all write file descriptors closed) returns an end-of-file. The signal SIGPIPE is generated if a write on a pipe with only one end is attempted. RETURN VALUE
The function value zero is returned if the pipe was created; -1 if an error occurred. ERRORS
The pipe call will fail if: [EMFILE] Too many descriptors are active. [ENFILE] The system file table is full. [ENOSPC] The pipe file system (usually the root file system) has no free inodes. [EFAULT] The fildes buffer is in an invalid area of the process's address space. SEE ALSO
sh(1), read(2), write(2), fork(2). NOTES
Writes may return ENOSPC errors if no pipe data can be buffered, because the pipe file system is full. BUGS
Should more than PIPE_MAX bytes be necessary in any pipe among a loop of processes, deadlock will occur. 4th Berkeley Distribution August 26, 1985 PIPE(2)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy