---
title: "對不同的輸入重複執行同一個指令"
description: "如果你必須對不同的輸入重複執行同一個指令。"
canonical: https://oozou.com/til/run-same-command-on-different-input-inputs-71
locale: zh-Hant
date: 2020-10-13
topic: shell
---

# 對不同的輸入重複執行同一個指令

> 如果你必須對不同的輸入重複執行同一個指令。

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hant/til-topics/shell) ([markdown](https://oozou.com/zh-Hant/til-topics/shell.md))

如果你必須對不同的輸入重複執行同一個指令。

範例輸入：

```
c595270372e3
c04094382ae1
498a6505a1f7
4ac0e1872789
170a7f2ec51a
930743cb4e19
```

指令：

```
pbpaste | xargs -I id docker image rm id
```

注意：*pbpaste* 是 Mac 的剪貼簿貼上指令，在其他作業系統上會有所不同。

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hant/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
