What made you prefer to use ed over vi?
ed is the standard text editor!
Eat flaming death!
What’s the reason for the first line that runs which rulr?
Well, it doesn’t actually just execute which rulr. Since it’s written in backticks, that means “run which rulr and run its result as an argument to csh -f
I have no idea what rulr does though, and can’t find any information about it.
It is not an argument to -f as -f means load fast (without consulting ~/.cshrc) not use this file. But in this case the command means execute the script in the path that results from which as a csh script file. Which is kind of weird since which already checks among the executables in the path. Maybe rurl is an executable csh script but without the shebang on top?
It’s likely that the csh in $PATH is not at a standard place, and/or the shebang in rulr points to an nonexistent csh, as the author hinted at a nonstandard environment.
The comment implies it inserts a ruler (maybe a line of dashes?). Though why this is called using which and in combo with csh is unclear.
Oh yeah that makes sense. I was assuming “ruler = measuring device” and was incredibly confused as to why anyone would print that to their terminal before doing something like that.
Makes sense that this would print a <hr />-style horizontal rule.
But yeah, I’m also confused as to why it had to be called in combination with which, doesn’t which try to find something in one’s $PATH and therefore if it’s in $PATH, calling just rulr would work just fine?
It might make sense with ed, in case you want a ruler to recognize indentations.
Does strace show a difference between write calls for ed and vi?
I had a fairly similar issue using Parallels to run a Vagrant VM
Some software inside the vm would not properly read a file updated on the host, and would instead get garbage while cat in particular would read the updated file fine.
This looks very much like a sync problem of osxfs, no? Did you try to change the consistency strategy of your volume mount ? https://docs.docker.com/docker-for-mac/osxfs-caching/#consistent
csh? ed? My god, it’s 1978 all over again.
The most pain you’ve ever felt?
Does sync $filename after using ed work?
Well it’s an ugly hack all right. But I can’t say that I haven’t written any ugly hacks and kept them running for way longer than anyone ever should.
I can’t help but wonder whether vim -e $* would suffice.
vim -e $*