Re: a question of sed

Paolo Bonzini <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
Il 15/09/2014 09:36, runhao chen ha scritto:
> root@roger-T540p-Ubuntu:/home/roger/work/shell# sed -n -i '3d' emp.txt
> root@roger-T540p-Ubuntu:/home/roger/work/shell# cat emp.txt
> root@roger-T540p-Ubuntu:/home/roger/work/shell#
> *******************************************************************end of
> log
> 
> I just want to delete the third line " what happened?!", and after the
> command, all lines were deleted.
> 
> did it suppose to be ?

Yes, you should not have included -n.

Paolo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.