On MKS SED for Windows, this
TYPE Q:\temp\curtainssetspread.M3U | SED -E "/z/{s_a_b_}"
fails with
sed: garbage after command
Why?
This usage accords correctly with docs:
a,b{ groups all commands until the next matching }, so that sed executes the entire group only if the { command is selected by its address(es).
According to POSIX, the
}must be preceded by a newline. I'm not sure what MKS does, but the beauty of having a standard is that the following should work on all systems (using multiple-es joins each string together with newlines in between):If it doesn't work, it's a bug in MKS and should be reported, as they say their
sedis POSIX-compliant.I do suggest following Benjamin's advice and just doing
if possible, though.