note
dmitri
A couple of thoughts:
<p>
The cutting up of input stream as you describe can be much done much easier with <tt>sed</tt>, for instance, instead of
<code>
query-students | sort | unhead '^D' | untail '^G'
</code>
do
<code>
query-students | sort | sed '/^D/,/^G/p; d'
</code>
Also, neither <tt>head</tt> nor <tt>tail</tt> modify files they operate on. I understand, you were probably solving a specific problem, but this script can be generalized even more.
249987
249987