here's one more way using awk:

awk '{if (NR>start && NR<end) print NR," ",$0}' [source file] > output; echo
'yes' | cp output source

second part is to replace the source with the output.

print line from start to end, redirect as you want


On Fri, Nov 7, 2008 at 11:29, narendra sisodiya <[EMAIL PROTECTED]
> wrote:

> $ tail -n+2 file1.txt
>
> this will print full file ,, except first line,,,
> so,, redirect to new file
>
>
> $ tail -n+2 file1.txt > file1.txt.new
>
> or better first move file
>
> $ mv file1.txt file1.txt.old
> $ tail -n+2 file1.txt.old > file1.txt
>
>
> >
>


-- 
Lots o' Luv,
Phani Bhushan

Let not your sense of morals prevent you from doing what is right - Isaac
Asimov (Salvor Hardin in Foundation and Empire)

--~--~---------~--~----~------------~-------~--~----~
[EMAIL PROTECTED] mailing list -- group http://groups.google.com/group/iitdlug
-~----------~----~----~----~------~----~------~--~---

Reply via email to