Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
7
Newest
 Curious
Impact
~454 people reached

  • 0 posts edited
  • 0 helpful flags
  • 28 votes cast
Feb
26
awarded  Curious
Feb
26
comment Can I resend a message with (plain) mailx?
Thanks a lot for such a thorough (and correct!) answer!
Feb
26
accepted Can I resend a message with (plain) mailx?
Feb
25
asked Can I resend a message with (plain) mailx?
Jan
2
comment Echoing stdin when running an ed(1) script
[Meta-question: for some reason my "at"+"your username" doesn't stick. Maybe because I asked the question?] I forgot about split(1). Yes, I'd be inclined to delete all files beginning with x, maybe in a temporary directory. I'm pretty sure split(1) generates file names in alphabetical order, so that cat $x* gives you back the original file. I've used it in that basic way a few times. The UNIX founders got a lot of things right!
Jan
2
comment Echoing stdin when running an ed(1) script
Thanks again! Now I see why IFS= is there, even if the whole line is to be read into a single variable. Some information may be lost. Unlikely in this case, but nice to know this best practice. If I may ask, did you pick all of this up "by doing and learning", or was there a single source/book that you followed carefully and would suggest. Thanks once more! Happy 2015!
Jan
1
comment Echoing stdin when running an ed(1) script
Wow! That looks hard to debug, let alone understand in my case... Moreover, the output is not quite what I described. Thanks for your input in any event!
Jan
1
comment Echoing stdin when running an ed(1) script
Thanks again, Don. (Sorry for the name update in the middle of this thread.) I guess your second method can become way simpler by running rm x* first and then simply for i in x*; do cat $x | tee /dev/tty; done | ed. I will probably feel most comfortable adapting Mark's answer with printf '%s\n' "$line" instead of echo "$line", removing IFS= as there's only one variable and changing sleep 0.5 to sleep 0 (noticing the many options you said I would have). I learned a lot with your feedback! Thanks!
Dec
31
comment Echoing stdin when running an ed(1) script
In case anybody likes this solution, use printf '%s\n' "$line" instead of echo "$line" for greater portability.
Dec
30
awarded  Commentator
Dec
30
comment Echoing stdin when running an ed(1) script
Thanks for you reply. Although I could follow your approach more easily, I went with Don's solutions as they turn out to be more portable. It turns out read -r doesn't really capture a raw line everywhere, or at least not in OpenBSD ("\\" becomes "\", much to my puzzlement!). One more note: running Don's scripts it looks like sleep 0.5 is way too cautious, as it can be in fact lowered to sleep 0.
Dec
30
comment Echoing stdin when running an ed(1) script
Thanks for your answers! If I understand correctly the last approach is exclusively pedagogic, as it is longer, involves splitting the script, and has the line/pattern addressing issue which is not present in the first two solutions. (Right?)
Dec
30
accepted Echoing stdin when running an ed(1) script
Dec
29
revised Echoing stdin when running an ed(1) script
edited tags
Dec
29
awarded  Editor
Dec
29
comment Echoing stdin when running an ed(1) script
Thanks, Alexej. I've added some context in my edit to justify my goal. It may very well not be easily doable.
Dec
29
revised Echoing stdin when running an ed(1) script
added 353 characters in body
Dec
29
asked Echoing stdin when running an ed(1) script
Jul
13
comment How can you achieve vi's `se ai` in Emacs?
Thanks, bdowning. I was hoping for something even in fundamental mode.
Jul
13
comment How can you achieve vi's `se ai` in Emacs?
jordanm, your link does it for me (I'm disappointed at the verbosity required if you don't want to press C-J instead of RET...). Feel free to leave an answer so I can accept it.