You're viewing a comment by Dave Cross and its responses.

April 27, 2011, 16:49

The range operator is cleverer than you think. You can print lines 17 to 30 in a file like this:

perl -ne 'print if 17 .. 30'

You can (obviously) also use that for printing the first 10 lines of a file:

perl -ne '1 .. 10'

Comment Responses

April 27, 2011, 16:51

Dave, wow, I didn't know that. Thanks for the comment, it was very valuable!

April 28, 2011, 05:16

That second example is wrong.

perl -ne 'print if 1 .. 10'

August 11, 2014, 17:47

I really love your blog.I wanted to thank you for this great read!! I definitely enjoying each and every little bit of the article and I have you bookmarked your site to check out new stuff you post.

independence day images.

Aman Permalink
August 12, 2014, 15:09

Thanks you, I was facing the same problem with my website Geekscab.com

Best Whatsapp Status

Thanks you

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.