/write -d file.txt
Will remove the last line of a file, without knowning what number it is.
You could perhaps do something like
alias addme {
var %f = "[color:red]file.txt"
write %f $1-
timerdl. $+ $lines(%f) 1 5 write -dl %f
}
[/color]
So it runs -dl the same number of times you /write, might have some issues with it though, give it a try i suppose, /addme text.
Eamonn.