in reply to unhead and untail
A couple of thoughts:
The cutting up of input stream as you describe can be much done much easier with sed, for instance, instead of
doquery-students | sort | unhead '^D' | untail '^G'
Also, neither head nor tail modify files they operate on. I understand, you were probably solving a specific problem, but this script can be generalized even more.query-students | sort | sed '/^D/,/^G/p; d'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: unhead and untail (GNU sed -i)
by Aristotle (Chancellor) on Apr 15, 2003 at 20:09 UTC | |
by dmitri (Priest) on Apr 15, 2003 at 20:41 UTC |
In Section
Code Catacombs