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 o...@actcom.co.il wrote: On Tuesday, 23 בDecember 2008, Erez D wrote: On Tue, Dec 23, 2008 at

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 it to

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 linux...@fenster-mail.com wrote: Using trusty awk - awk -v line_num=5 '{if(NR == line_num){next;} print $0;}' file On 24-Dec-2008 13:34 ,

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

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 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 be

Re: un-head

2008-12-24 Thread Erez D
On Wed, Dec 24, 2008 at 3:03 PM, Dan Shimshoni danshi...@gmail.com 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

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 linux...@fenster-mail.com 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

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 file 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 unhead

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

Re: un-head

2008-12-23 Thread Valery Reznic
--- On Tue, 12/23/08, Baruch Siach bar...@tkos.co.il wrote: From: Baruch Siach bar...@tkos.co.il Subject: Re: un-head To: Erez D erez0...@gmail.com Cc: linux-il linux-il@cs.huji.ac.il Date: Tuesday, December 23, 2008, 10:07 AM Hi Erez, On Tue, Dec 23, 2008 at 09:53:00AM +0200, Erez D

Re: un-head

2008-12-23 Thread Erez D
On Tue, Dec 23, 2008 at 10:17 AM, Valery Reznic valery_rez...@yahoo.comwrote: --- On Tue, 12/23/08, Baruch Siach bar...@tkos.co.il wrote: From: Baruch Siach bar...@tkos.co.il Subject: Re: un-head To: Erez D erez0...@gmail.com Cc: linux-il linux-il@cs.huji.ac.il Date: Tuesday

Re: un-head

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

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 bar...@tkos.co.il 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

un-head

2008-12-22 Thread Erez D
hi head -5 file 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 unhead util that does that for me ? erez.