0

export variableメソッドを使用する場合、次のbashシェルはeofを無視できます(^ Dを押すと終了しません)。しかし、^Dを押すことで子bashを終了できるようにしたいと思います。この仕事をすることができるbashのコマンドラインオプションはありますか?

export ignoreeof=1
exec bash  # assume this bash's pid = 1234
bash$  ^D  
bash$  Use "exit" to leave the shell.
bash$  bash  # assume this bash's pid = 2234
bash$  ^D  <--  I wish this could exit bash(pid=2234)
4

2 に答える 2

1
ignoreeof=0 exec bash

トリックを行う必要があります

于 2012-05-05T05:15:27.827 に答える
0

ウィリアム、あなたのヒントに感謝します。

exec bash -o ignoreeof # assume this bash's pid = 1234
bash$  ^D  
bash$  Use "exit" to leave the shell.
bash$  bash  # assume this bash's pid = 2234
bash$  ^D  <--  exit bash(pid=2234)
于 2012-05-06T13:59:38.377 に答える