[Dresden-pm] Zeile n bis m anzeigen?

Stephan Maka stephan at spaceboyz.net
Fre Jan 27 10:36:48 PST 2006


Steffen Schwigon wrote:
> Ich will alle Zeilen einer Datei von einer Zeile n bis zur Zeile m
> ausgeben, auf Kommandozeile. Das klingt so, als müsste es superleicht
> gehen, ich finde aber nichts. Vorschläge?

ruby -e 'f,n,m=ARGV;print IO.readlines(f)[n.to_i-1..m.to_i-1]' /etc/passwd 5 23
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/dresden-pm/attachments/20060127/aa913248/attachment.bin