我有两种情况:
#!/usr/bin/env bash
sleep infinity
# When I type Ctrl-C here, "sleep" command and script are stopped so I didn't see "End"
echo End
Run Code Online (Sandbox Code Playgroud)
#!/usr/bin/env bash
docker exec container-id sleep infinity
# When I type Ctrl-C here, "docker exec" command is stopped but script continued so I saw "End"
echo End
Run Code Online (Sandbox Code Playgroud)
为什么行为上有差异?
| 归档时间: |
|
| 查看次数: |
923 次 |
| 最近记录: |