learning about pipes!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers learning about pipes!
# 1  
Old 07-26-2008
learning about pipes!

im trying to figure out how to do the following:

using pipes to combine grep and find commands to print all lines in files that start with the letter f in the current directory that contain the word "test" for example?

again using pipes to combine grep and find command, how can I print all the file names starting with f whose names also contain the word "test", again in the current directory?

combining grep and cat commands , i need the print the number of lines in "testa.txt" and "testb.txt" that contain the string hello.c

combining tail and grep commands, if the string "pipes" is in the last 5 lines of a test.txt file, then i want to print the lines it is in.

combing head, tail, grep commands, if the string "pipes" is in lines 10-14 of file test.txt, the print the lines it is in.

thanks for any help!
# 2  
Old 07-26-2008
This smells like homework, thread closed!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using pipes within variables

Hi, I'm trying avoid having a large number of 'if' statements in my script by setting up a variable within 'ksh' which can be expanded depending on parameters passed to the script. The output from the 'cat' command should be able pipe its output into any additional commands on the command line... (4 Replies)
Discussion started by: stv_t
4 Replies

2. Programming

Pipes in C

Hello all, I am trying to learn more about programming Unix pipes in C. I have created a pipe that does od -bc < myfile | head Now, I am trying to create od -bc < myfile | head | wc Here is my code, and I know I might be off, thats why I am here so I can get some clarification. #include... (1 Reply)
Discussion started by: petrca
1 Replies

3. Shell Programming and Scripting

Pipes not working

Hi, thanks for b4. can anyone tell me why following not working: noUsers=$(who | cut -d" " -f1 | wc -l) What i'm trying to do is get a list of logged on users and pass it to 'wc -l' and store the output to a variable. Any ideas? (1 Reply)
Discussion started by: Furqan_79
1 Replies

4. Shell Programming and Scripting

Help with pipes in a file

I have to add pipes for particualr number of records in a file. For eg the file has 10 records and i need to add the "|" for records numbers 7 to 10 at particular positons as shown. I need to add pipes in each of these records at positions 9, 11,,21 as like below. Can some body... (7 Replies)
Discussion started by: dsravan
7 Replies

5. UNIX for Advanced & Expert Users

Consolidating Pipes

This is something I've given a lot of thought to and come up with no answer. Say you have a data stream passing from a file, through process A, into process B. Process A only modifies a few bytes of the stream, then prints the rest of the stream unmodified. Is there any way to stream the file... (4 Replies)
Discussion started by: Corona688
4 Replies

6. UNIX for Advanced & Expert Users

FIFO Pipes

Hi...Can anyone please guide me on FIFO Pipes in UNIX.I have lerant things like creating fifo pipes,using them for reads and writes etc.I want to know what is the maximum amount of memory that such a pipe may have? Also can anyone guide me on where to get info on this topic from? (4 Replies)
Discussion started by: tej.buch
4 Replies

7. UNIX for Dummies Questions & Answers

Two types of pipes?

What is the difference between: cd /tmp tar -cf - *.txt |gzip > tmp_txt.tar.gz and cd /tmp mknod pipe p gzip < pipe > /tmp/tmp_txt1.tar.gz & tar -cf pipe *.txt Apart from the fact that we have to create the pipe file manually, is there any difference in the performance of the two?... (5 Replies)
Discussion started by: blowtorch
5 Replies

8. Programming

pipes + structs

heya got a small problem here. im trying to pipe eg: 'ls | more'. i have created a command line parser which separates ls and more into two commands. i have also created a struct, each struct has a command name, number of arguments, redirect_in, redirect_out, pipe_in, etc etc.... eg: struct... (0 Replies)
Discussion started by: mile1982
0 Replies

9. Shell Programming and Scripting

cd using pipes

Hi, Can the cd command be invoked using pipes??? My actual question is slightly different. I am trying to run an executable from different folders and the path of these folders are obtained dynamically from the front end. Is there a way in which i can actually run the executable... (2 Replies)
Discussion started by: Sinbad
2 Replies

10. Filesystems, Disks and Memory

PIPEs and Named PIPEs (FIFO) Buffer size

Hello! How I can increase or decrease predefined pipe buffer size? System FreeBSD 4.9 and RedHat Linux 9.0 Thanks! (1 Reply)
Discussion started by: Jus
1 Replies
Login or Register to Ask a Question