I've written a small utility that does easily extract line slices. It has currently one convenience switch "-n", which triggers numbered output.
Sample invocations: $ linecut --range 1,10:50,80:-200,-1 --number <file> $ linecut --range 10,-10 --number <file> $ linecut --range 15,15:18,18 --number <file> Likewise for input streams from | and <. There's even more stuff possible, but I don't think it'd be useful (artefact of implementation). I'm here to collect opinions & suggestions, so feel free to reject the idea. Would it be considered as an useful addition to coreutils, some things should be eventually and others definitely changed: a) merge line-numbering routine from 'cat' b) undo the modularization c) undo two ways of operation (seeking/buffering) d) extend 'head' e) everything else People who think it'd be worthwhile are welcomed to jump in and hack on it. Source: http://steven.xwave.ch/code/linecut/ -- Without accepting the fact that everything changes, we cannot find perfect composure. But unfortunately, although it is true, it is difficult for us to accept it. Because we cannot accept the truth of transience, we suffer. -- Shunryu Suzuki _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
