zettel/19172b64.md
2021-03-14 15:52:16 -07:00

445 B

date tags
2021-03-14T15:48
vim

specifying a range when running a ! shell command filters

Specifying a range when running a ! shell command filters the range through the specified shell command by piping the range's content into the shell command via stdin and replacing the range with the shell command's stdout.

Running

:1,10!sort -r

on

2
3
7
1
9
4
0
8
5
6

results in:

9
8
7
6
5
4
3
2
1
0