Skip to main content
added 1 character in body
Source Link
Enlico
  • 2.4k
  • 2
  • 26
  • 50

As it happens, by writing the question, I think I've maybe come up with the answer. I'll delete it if somebody else actually proves I'm wrong and gives the corectcorrect answer.

I suppose the problem is that sed is line-oriented, whether the line separators are \n or \x0 (the latter is the case when passing the -z option, I understand), so an infinite stream consisting of repetitions of one character is just not a valid input to sed, because it means one of two things:

  • if that infinitely repeated character is \n (resp. \x0), and sed was launched without (resp. with) the -z option, then the input stream is an infinite number of empty lines,
  • otherwise, the input stream is a single, infinitely long line composed of an infinite number of repetitions of that character.

As it happens, by writing the question, I think I've maybe come up with the answer. I'll delete it if somebody else actually proves I'm wrong and gives the corect answer.

I suppose the problem is that sed is line-oriented, whether the line separators are \n or \x0 (the latter is the case when passing the -z option, I understand), so an infinite stream one character is just not a valid input to sed, because it means one of two things:

  • if that infinitely repeated character is \n (resp. \x0), and sed was launched without (resp. with) the -z option, then the input stream is an infinite number of empty lines,
  • otherwise, the input stream is a single line composed of an infinite number of repetitions of that character.

As it happens, by writing the question, I think I've maybe come up with the answer. I'll delete it if somebody else actually proves I'm wrong and gives the correct answer.

I suppose the problem is that sed is line-oriented, whether the line separators are \n or \x0 (the latter is the case when passing the -z option, I understand), so an infinite stream consisting of repetitions of one character is just not a valid input to sed, because it means one of two things:

  • if that infinitely repeated character is \n (resp. \x0), and sed was launched without (resp. with) the -z option, then the input stream is an infinite number of empty lines,
  • otherwise, the input stream is a single, infinitely long line composed of an infinite number of repetitions of that character.
Source Link
Enlico
  • 2.4k
  • 2
  • 26
  • 50

As it happens, by writing the question, I think I've maybe come up with the answer. I'll delete it if somebody else actually proves I'm wrong and gives the corect answer.

I suppose the problem is that sed is line-oriented, whether the line separators are \n or \x0 (the latter is the case when passing the -z option, I understand), so an infinite stream one character is just not a valid input to sed, because it means one of two things:

  • if that infinitely repeated character is \n (resp. \x0), and sed was launched without (resp. with) the -z option, then the input stream is an infinite number of empty lines,
  • otherwise, the input stream is a single line composed of an infinite number of repetitions of that character.