LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2011, 02:13 PM   #1
lionfun
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Unhappy why seq 10 | sed -e '1,2d' -e '1,2d' just delete three lines ?


Code:
[root@station3 ~]# seq 10 | sed -e '1,2d' -e '1,2d'
4
5
6
7
8
9
10
We can see that sed just deletes the first three lines.
Can someone tell me how "seq 10 | sed -e '1,2d' -e '1,2d'"works?thanks!
 
Old 06-30-2011, 02:57 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

This very much smacks of homework; how about you share your
own thoughts on what might be going on after having read the
man-page for seq and the info-pages for sed, and we then tell
you how you're doing with your assertions?


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Delete last 6 lines of file with sed drexnefex Linux - Newbie 6 06-06-2011 11:44 AM
Delete region of lines with sed freeindy Programming 7 09-21-2008 05:12 PM
Sed: how to delete all lines except those matching........ DX398 Programming 9 07-23-2008 03:39 AM
delete lines with sed LuciusHunt Programming 1 04-19-2008 03:40 PM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 10:19 AM


All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration