https://github.com/icexin/pcmd
Paralleled command execution tool
https://github.com/icexin/pcmd
command-execution parallel
Last synced: 11 months ago
JSON representation
Paralleled command execution tool
- Host: GitHub
- URL: https://github.com/icexin/pcmd
- Owner: icexin
- Created: 2017-12-28T08:10:49.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T03:47:09.000Z (about 8 years ago)
- Last Synced: 2024-12-31T05:28:49.795Z (about 1 year ago)
- Topics: command-execution, parallel
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Paralleled command execution tool
## Overview
假设你有一个url列表文件,每行一个url,你想并发使用curl命令把列表里的地址抓下来保存到文件里面,pcmd或许能帮助你。
```
cat url.txt | pcmd -c 100 'echo "downloading {{1}}" && curl {{1}} > {{1}}.html'
```
上面命令将以100的并发来下载文件。
## Install
`go get github.com/icexin/pcmd`
## Usage
pcmd从标准输入里面把每一行按空格,tab分割,第一个字段是`{{1}}`,第二个是`{{2}}`,以此类推,总共可以支持9个占位符。
`{{i}}`表示数据的行号
-c 指定并发数