I am trying to delete the last line in a file. I am able to this using
sed '$d' 1 > 2 && cp 2 1
Could someone please tell me a more efficient implementation. I am able to do my task using a read,write and copy.
Is it possible to do this using only one read and one write operation.
No need to use two commands. Use
sed‘s in-place edit: