how to continue run script after tail -f command

前端 未结 6 829
攒了一身酷
攒了一身酷 2021-01-18 09:55

I have the following script:

tail -f nohup.out
echo 5

When I press Ctrl+C on tail -f, the script stops r

6条回答
  •  盖世英雄少女心
    2021-01-18 10:04

    As mentioned by rwos , but adding inline trapping.

    bash -i -c "trap ' ' SIGINT; tail -F '$1'; trap - SIGINT"
    

    This would work without closing putty session when issuing subsequent SIGINT signals (that was my problem)

提交回复
热议问题