0

I'm patching my and creating a diff file through this command:

diff a my_patch > sw.diff

Here "a" is my first file, my_patch is a patch.

So now I have sw.diff file with differences. But there's an extra line down there at the end of the file:

< an armored space station with enough power to destroy an entire planet.
8d10
< Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy...

How to remove it? Is it possible?

Hamada
  • 1,836
  • 3
  • 13
  • 27
Blazing_Sun
  • 93
  • 1
  • 1
  • 6
  • Does this answer your question? [Remove the last line from a file in Bash](https://stackoverflow.com/questions/4881930/remove-the-last-line-from-a-file-in-bash). In short: Pipe your command through `sed '$d'`. – Socowi Jun 22 '20 at 13:31
  • 1
    `printf '%s\n' '$d' w | ed -s sw.diff` – Jetchisel Jun 22 '20 at 20:55

0 Answers0