Re: un-head

2008-12-24 Thread Oleg Goldshmidt
On Wed, Dec 24, 2008 at 2:06 PM, Yaacov Fenster - System Engineering Troubleshooting and other stuff wrote: > Using trusty awk - > > awk -v line_num=5 '{if(NR == line_num){next;} print $0;}' < file >> Using trusty awk - >> >> awk -v line_num=5 '{if(NR == line_num){next;} print $0;}' < file AWK h

Re: un-head

2008-12-24 Thread Erez D
On Wed, Dec 24, 2008 at 3:03 PM, Dan Shimshoni wrote: > Thanks! > I want that the output will be be not the console, as it is by your > offer, but to the same file. > Namely , running the script on input.txt will delete a line in that > file so that after running the script,input.txt will be the

Re: un-head

2008-12-24 Thread Tzafrir Cohen
On Wed, Dec 24, 2008 at 03:03:08PM +0200, Dan Shimshoni wrote: > Thanks! > I want that the output will be be not the console, as it is by your > offer, but to the same file. > Namely , running the script on input.txt will delete a line in that > file so that after running the script,input.txt will

Re: un-head

2008-12-24 Thread Yaacov Fenster - System Engineering Troubleshooting and other stuff
Using trusty awk - awk -v line_num=5 '{if(NR == line_num){next;} print $0;}' < file On 24-Dec-2008 13:34 , Dan Shimshoni wrote: Hello, - And in the same fun spirit : Is it possible to delete a line in a specified file , given the number of the line, in a non-sed script ? DanS On Wed, Dec

Re: un-head

2008-12-24 Thread Dan Shimshoni
Thanks! I want that the output will be be not the console, as it is by your offer, but to the same file. Namely , running the script on input.txt will delete a line in that file so that after running the script,input.txt will be the same but without line 5. It can be done by two lines following yo

Re: un-head

2008-12-24 Thread Erez D
remove line #5: awk '{ if (++l!=5) print $0}' On Wed, Dec 24, 2008 at 2:06 PM, Yaacov Fenster - System Engineering Troubleshooting and other stuff wrote: > Using trusty awk - > > awk -v line_num=5 '{if(NR == line_num){next;} print $0;}' < file > > > On 24-Dec-2008 13:34 , Dan Shimshoni wrote:

Re: un-head

2008-12-24 Thread Tzafrir Cohen
On Wed, Dec 24, 2008 at 01:34:08PM +0200, Dan Shimshoni wrote: > Hello, > > - And in the same fun spirit : > Is it possible to delete a line in a specified file , given the > number of the line, in a non-sed script ? in-line editing? perl? python? what other language? Or do you want to limit i

Re: un-head

2008-12-24 Thread Dan Shimshoni
Hello, - And in the same fun spirit : Is it possible to delete a line in a specified file , given the number of the line, in a non-sed script ? DanS On Wed, Dec 24, 2008 at 9:08 AM, Oron Peled wrote: > On Tuesday, 23 בDecember 2008, Erez D wrote: > >> On Tue, Dec 23, 2008 at 10:17 AM, Valery

Re: un-head

2008-12-23 Thread Oron Peled
On Tuesday, 23 בDecember 2008, Erez D wrote: > On Tue, Dec 23, 2008 at 10:17 AM, Valery Reznic wrote: > > > --- On Tue, 12/23/08, Baruch Siach wrote: > > > tail -n +5 > > It should be +6 > That is the reson i preffer "sed '1,5d' " over "tail -n +6" Since everyone are having fun, here is another

Re: un-head

2008-12-23 Thread Valery Reznic
tail -n +6 Valery --- On Tue, 12/23/08, Tzafrir Cohen wrote: > From: Tzafrir Cohen > Subject: Re: un-head > To: "linux-il" > Date: Tuesday, December 23, 2008, 10:03 AM > On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D wrote: > > hi > > > > head -

Re: un-head

2008-12-23 Thread Erez D
On Tue, Dec 23, 2008 at 10:17 AM, Valery Reznic wrote: > > > > --- On Tue, 12/23/08, Baruch Siach wrote: > > > From: Baruch Siach > > Subject: Re: un-head > > To: "Erez D" > > Cc: "linux-il" > > Date: Tuesday, December 23, 2008,

Re: un-head

2008-12-23 Thread Valery Reznic
--- On Tue, 12/23/08, Baruch Siach wrote: > From: Baruch Siach > Subject: Re: un-head > To: "Erez D" > Cc: "linux-il" > Date: Tuesday, December 23, 2008, 10:07 AM > Hi Erez, > > On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D wrote: &g

Re: un-head

2008-12-23 Thread Yedidyah Bar-David
On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D wrote: > hi > > head -5 will give me the first 5 lines of file. > > i'm looking for somthing that will give me everything but the first 5 lines. > > i know i can get the lines with 'wc -l' , then substract 5, and then use > tail. > is there an un

Re: un-head

2008-12-23 Thread Erez D
what i love about linux, is that there are always more than one way to do what i want ... thank you all erez.

Re: un-head

2008-12-23 Thread Baruch Siach
Hi Erez, On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D wrote: > i'm looking for somthing that will give me everything but the first 5 lines. tail -n +5 baruch -- ~. .~ Tk Open Systems =}oo

Re: un-head

2008-12-23 Thread Tzafrir Cohen
On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D wrote: > hi > > head -5 will give me the first 5 lines of file. > > i'm looking for somthing that will give me everything but the first 5 lines. > > i know i can get the lines with 'wc -l' , then substract 5, and then use > tail. > is there an un