Re: delete last line
- From: Bill Campbell <bill@xxxxxxxxxxxxx>
- Date: Thu, 10 Jan 2008 15:59:51 -0800
On Thu, Jan 10, 2008, Jean-Pierre Radley wrote:
pablo typed (on Thu, Jan 10, 2008 at 02:03:03PM -0800):
| how can I delete the last line of a text file from the command line ?
|
| I mean only last line
sed '$d' in.file > out.file
In place edit using the ex editor (would probably work with ed as well.
ex - filename <<DONE
$d
w
q
DONE
Using the gnu shtool program:
shtool subst -e '$d' filename
Bill
--
INTERNET: bill@xxxxxxxxxxxxx Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
The only freedom which deserves the name, is that of pursuing our own good
in our own way, so long as we do not attempt to deprive others of theirs,
or impede their efforts to obtain it. -- John Stuart Mill, 1859
.
- References:
- delete last line
- From: pablo
- Re: delete last line
- From: Jean-Pierre Radley
- delete last line
- Prev by Date: Re: delete last line
- Next by Date: Re: Printer does not show up when running the command lpstat after installing Maintenance Pack 5 for Openserver 5.0.7
- Previous by thread: Re: delete last line
- Next by thread: Re: delete last line
- Index(es):
Relevant Pages
|