4 ms·
Good post. It's also not hard to throw together quick data stream-processing tools like that in awk or C. I have a couple: drop (opposite of "head"), til ("til
by silentbicycle 16y ago
Good post. It's also not hard to throw together quick data stream-processing tools like that in awk or C. I have a couple: drop (opposite of "head"), til ("til 10" -> "0 1 2 3 4 5 6 7 8 9"), slice (read given 4kb chunk numbers from file, via mmap), and dozens of little scripts. I don't really care for shell scripting, but awk is great.
If you want more stuff like this, check out _The Unix Programming Environment_ and _The Awk Programming Language_. Both co-written by Brian Kernighan.
- raghava 16y ago> drop, til, slice tac (to read a file in reverse line order), nl (numbering the lines), seq (somewhat like til), paste, join (merging), fold (wrapping text) to add a few more.
- mturmon 16y agoDoesn't tail +n do what your "drop" does? (Starts reading n lines from the beginning.)
- silentbicycle 16y agoIt does! Didn't know that, thanks. :) I didn't check, given the name. ("til" and "drop" are names from k.)