次: head, 前: wc -w, 上: Examples
sedはにwc -lの機能があるので,今回はおかしなことを何も しません!!! まあ見てください.
wc -l
#!/usr/bin/sed -nf $=