Reputation
1,248
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 10 22
Newest
 Necromancer
Impact
~89k people reached

1d
awarded  Necromancer
Aug
20
awarded  Notable Question
Aug
18
awarded  Good Question
Aug
13
awarded  Nice Answer
Jul
31
awarded  Explainer
Jul
31
comment Linux LUKS encrypt and cloning machines
Yes, but you should convince yourself of the fact. Read the paragraph 2.4 What is the difference between "plain" and LUKS format on the Cryptsetup FAQ.
Jul
30
revised Linux LUKS encrypt and cloning machines
typo in title
Jul
30
suggested approved edit on Linux LUKS encrypt and cloning machines
Jul
30
answered Linux LUKS encrypt and cloning machines
Jul
29
comment Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
the sol1_5 works well. I have just modified my Ruby script to insert a newline if it blocks. Again, probably not the best code in the world but it works and the data stream isn't so great that writing a character at a time really bothers me. One difference I note is that my code passes anything through, inserting newlines before any delimiters in the stream, whereas yours drops lines without delimiters. Not a major issue as the stream is compliant with that but a minor difference nonetheless
Jul
29
revised Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
added 54 characters in body
Jul
29
revised Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
added updated example with non-blocking reads
Jul
29
accepted Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
Jul
29
comment Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
Well it isn't my Ruby program. I've done some tests and the downstream pipe (systemd-cat in my case) buffers until it gets a newline. If I just run the pipe into my Ruby program from a terminal than I get all the output immediately. To my Ruby program the input is one long line. I wonder if I could detect the stream blocking and send a newline if the last character wasn't...
Jul
29
comment Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
just noticed I have the same issue. I'm looking to see if I can fix it...
Jul
29
comment Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
I thought your sol2 was the way to go for a second there, but it still buffers the end of line as you said in your answer. I have some timings for you (input yields 93 lines after processing): your original solution: real0.008s user0s sys0.003s; sol1: r0.022s u0.003s s 0.020s; sol2: r0.026s u0.003s s0.003s sol2: 0.022s and my Ruby script: r0.045s u0.033s s0.010s.
Jul
29
awarded  Enthusiast
Jul
28
revised Is it possible to add a process to the job list in bash (e.g. to reverse “disown”)?
fix typo
Jul
28
accepted Can socat be started directly by systemd?
Jul
28
comment Is it possible, with `sed` or otherwise, to apply a regex transform to an input stream that may not contain newlines?
@PSkocik you're right. it does work with -n. My prompt clears the current line before displaying and that hid it.