1. 43
  1.  

  2. 10

    What made you prefer to use ed over vi?

    1. 19

      ed is the standard text editor!

      1. 6
    2. 8

      What’s the reason for the first line that runs which rulr?

      1. 2

        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.

        1. 5

          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?

          1. 1

            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.

          2. 2

            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.

            1. 2

              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?

              1. 5

                It might make sense with ed, in case you want a ruler to recognize indentations.

        2. 7

          Does strace show a difference between write calls for ed and vi?

          1. 3

            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.

            https://github.com/Parallels/vagrant-parallels/issues/330

            1. 3

              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

              1. 3

                csh? ed? My god, it’s 1978 all over again.

                1. 2

                  ed(1)?

                  ::blink::

                    1. 1

                      Does sync $filename after using ed work?

                      1. 1

                        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.

                        1. 1

                          I can’t help but wonder whether vim -e $* would suffice.