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!
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
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
2. Shell Programming and Scripting
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
3. Programming
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
4. UNIX for Dummies Questions & Answers
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
5. UNIX for Advanced & Expert Users
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
6. UNIX for Advanced & Expert Users
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Programming
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
10. Shell Programming and Scripting
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
LEARN ABOUT DEBIAN
pipenightdreams
PIPENIGHTDREAMS(6) Games Manual PIPENIGHTDREAMS(6)
NAME
pipenightdreams - Just another pipe trip (PipeDream clon).
SYNOPSIS
pipenightdreams [--datadir <DATADIR>] [--fullscreen]
DESCRIPTION
pipenightdreams is a PipeDream style game. The objetive of the game is to carry liquid from some point to the exit using different kinds
of pipes. On each level there is a minimum number of required pipes that should be at least reached for it to be completed.
The score is increased by using as many pipes as possible an by collecting various bonus tokens making the liquid pass through their pipes.
There are also life bonus and, hopefully soon, "freeze tokens".
The game is not exactly a copy of PipeDream. It's based only on the facts I remember and on many other things which have been added, or
changed hoping for making it better.
KEYS
The game is entirely played using the keyboard and the key layout is as follows:
SPACE Puts the next pipe where the pointer is.
CURSOR KEYS
Move the pointer.
ENTER Speeds up the liquid (Avoids skillful players to get bored).
ESC Goes back to the main screen or exits.
BONUS TYPES
The various types of bonus tokens are the following:
LIFE BONUS
The purple one with a "L" on it.
SUPER BONUS
The red one with a "B" on it.
ULTRA BONUS
The blue one.
HYPER BONUS
The green one.
OPTIONS
--datadir <CUSTOM DATA DIR> is used when the data directory is not the default one ( /usr/share/games/pipenightdreams if installed from a
rpm package and /usr/local/share/games/pipenightdreams when installed by compiling the source package).
--fullscreen switchs to fullscreen mode.
BUGS
Not known.
SEE ALSO
Pipenightdreams home page at
http://www.libsdl.org/projects/pipenightdreams
AUTHORS
Waldemar A. Baraldi <baraldi@lacasilla.com.ar>
23rd May 2002 PIPENIGHTDREAMS(6)