How do I launch an editor from a shell script?

前端 未结 7 433
野性不改
野性不改 2021-02-04 03:44

I would like my tcsh script to launch an editor (e.g., vi, emacs):

#!/bin/tcsh
vi my_file

This starts up vi with my_file but first displays a w

7条回答
  •  时光说笑
    2021-02-04 04:30

    I was able to get the desired behavior under bash+Cygwin+Terminator:

    #!/bin/bash
    vim foo
    

    Run the script, vim loads, no error messages, behaves as normal. There are undoubtedly dozens of variations between our setups, however, so I can't hazard a guess as to what makes the difference. I'm curious what it is, but you got it working, which is the important part.

提交回复
热议问题