I was looking at thisquestion and thenwondered how I might implement my answer which usessed using purelyPOSIXex.The trick is that while in sed I can compare the hold space withthe pattern space to see if they are exactly equivalent (withG;/^\(.*\)\n\1$/{do something}), I know of no way to do such atest in ex.I know that in Vim I could Yank the first line and then type:2,$g/<C-r>0/d to almost do what I'm specifyingbut if the firstline contains anything but very straightforward alphanumeric textthis becomes chancy indeed, since the line is being dumped in as aregex, not just a string for comparison.  (And if the first linecontains a forward slash, the rest of the line will be interpretedas a command!)So if I want to delete all the lines in myfile that are identicalto the first linebut not delete the first linehow could I do thatusing ex?  For that matter, how could I do it using vi?Is there a POSIX way to delete a line if it exactly matches anotherline?Perhaps something like this imaginary syntax::2,$g/**lines equal to 0**/d
Use ex-command to check whether two lines are identical?
ex mode;original vi;ex command;posix