25 lines
No EOL
651 B
Markdown
25 lines
No EOL
651 B
Markdown
---
|
|
title: "percol to pick lines"
|
|
seo_description: "How to use percol to pick lines mid pipe"
|
|
date: 2023-05-16T15:37:29+02:00
|
|
draft: false
|
|
snippet_types:
|
|
- percol
|
|
---
|
|
|
|
Deep in a emac tutorial I discovered this hidden gem.
|
|
|
|
> "percol adds flavor of interactive selection to the traditional pipe concept on UNIX."
|
|
|
|
[project github](https://github.com/mooz/percol)
|
|
|
|
You can simply place it in the middle of a pipe and pick the options you want.
|
|
|
|
Example:
|
|
|
|
```shell
|
|
$ BUCKET="s3://cool-bucket" aws s3 ls $BUCKET | awk '{print $4}' | percol |sed "s;^;${BUCKET}/;" | xargs aws s3 rm
|
|
delete: ...
|
|
```
|
|
|
|
{{< asciicast-with-caption id="585386" title="demo" >}} |