---
title: "Discussion on \"Shell: wait, kill, trap 組合筆記\" | Hashnode"
description: "Discussion on \"Shell: wait, kill, trap 組合筆記\". Story\n有一個 python 的 single process script ，要模擬 multiprocess 情境，但又希望只用 shell script 觸發：\n\n同時跑起好幾個 process\n使用者輸入 Ctrl-C 就中斷所有 process\n要等到所有 process 都關掉才會結束 shell script\n\nimport time\ndef main():\n    while"
url: "https://hashnode.com/posts/shell-wait-kill-trap/661e8aa16b4e4f317074ce8b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Shell: wait, kill, trap 組合筆記](https://notes.mukyu.dev/shell-wait-kill-trap?utm_source=hashnode&utm_medium=feed)

Story 有一個 python 的 single process script ，要模擬 multiprocess 情境，但又希望只用 shell script 觸發： 同時跑起好幾個 process 使用者輸入 Ctrl-C 就中斷所有 process 要等到所有 process 都關掉才會結束 shell script import time def main(): while

Apr 16, 2024 · 1 min read · notes.mukyu.dev  
Updated Oct 27  
Read the article

-   [#bash](https://hashnode.com/tag/bash)

## Written by

[Patchouli](https://hashnode.com/@mudream4869)

@mudream4869 · Uohout

  
[View profile](https://hashnode.com/@mudream4869)

工程師帕秋莉~

後端工程師。 不定時張貼一些寫扣時的筆記，有時英文，有時中文。 「如果，我是魔女的話...」

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
