Edit shell script while it's running

前端 未结 11 1833
余生分开走
余生分开走 2020-11-27 03:18

Can you edit a shell script while it\'s running and have the changes affect the running script?

I\'m curious about the specific case of a csh script I have that batc

11条回答
  •  隐瞒了意图╮
    2020-11-27 03:42

    I'm hearing no... but what about with some indirection:

    BatchRunner.sh

    Command1.sh
    Command2.sh
    

    Command1.sh

    runSomething
    

    Command2.sh

    runSomethingElse
    

    Then you should be able to edit the contents of each command file before BatchRunner gets to it right?

    OR

    A cleaner version would have BatchRunner look to a single file where it would consecutively run one line at a time. Then you should be able to edit this second file while the first is running right?

提交回复
热议问题