Closed stephenwb closed 3 years ago
I’m 90% sure this does not work on the Mac which is why I went with the uglier alternative that I did. I’m on my iPad ATM so I can’t check, but I don’t want to merge it without checking.
Aha, that makes perfect sense. I wrote and tested that against a CentOS 7 box, I didn't have my Mac available during the day to test, I just ASSumed that head
would be standard.
Follow up: You are correct, of course. The MacOS version of head
does not understand -n -1
However, I still think that a short mention that there is, in fact, a Linux command that does this task would be valuable (even if it doesn't work in MacOS because the head
there is still from the good-old-days of BSD -- the man page footer says
BSD June 6, 1993 BSD
)!
Follow up: You are correct, of course. The MacOS version of
head
does not understand-n -1
However, I still think that a short mention that there is, in fact, a Linux command that does this task would be valuable (even if it doesn't work in MacOS because the
head
there is still from the good-old-days of BSD -- the man page footer saysBSD June 6, 1993 BSD
)!
Agreed — what's needed is a tweak to add the fact that it's Linux-only (or that it doesn't work on the Mac), then I'll happily merge.
@bbusschots Does this work for you?
I added a small section showing how to cut the last N lines off a file using
head -n -N filename
where N is the number of lines to remove.Since you talked in the actual show about the method you put in the notes, it doesn't seem to make sense to replace it completely, but you said something like "there isn't a command to cut the last line off of a file" but I think this is it.
Also, I forgot this commit also had a change of
echos
toechoes
, so I lied, there is one typo.