LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   why seq 10 | sed -e '1,2d' -e '1,2d' just delete three lines ? (https://www.linuxquestions.org/questions/linux-newbie-8/why-seq-10-%7C-sed-e-1-2d-e-1-2d-just-delete-three-lines-889236/)

lionfun 06-30-2011 01:13 PM

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!

Tinkster 06-30-2011 01:57 PM

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


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