LinuxCommandLibrary

vipe

Insert text editor into pipelines

TLDR

Edit pipe content

$ echo "text" | vipe
copy
Edit command output
$ cat [file.txt] | vipe | [next_command]
copy
Edit with specific editor
$ EDITOR=[vim] cat [file.txt] | vipe
copy
Transform data interactively
$ echo '{"key": "value"}' | vipe | jq .
copy

SYNOPSIS

vipe < stdin > stdout

DESCRIPTION

vipe inserts a text editor into a Unix pipeline. It reads standard input into a temporary file, opens it in the editor specified by the EDITOR or VISUAL environment variable, and writes the edited content to standard output when the editor exits.
This allows interactive modification of data flowing through a pipeline, which is useful for manually fixing input before it reaches the next command, debugging pipeline data, or performing one-off transformations that are easier to do in an editor than with sed or awk.

ENVIRONMENT

EDITOR - Editor to use
VISUAL - Visual editor

EXAMPLE

$ $ seq 5 | vipe | sort -r
# Editor opens with:
# 1
# 2
# 3
# 4
# 5
# Make edits, save, quit
# Output continues through sort
copy

CAVEATS

Part of moreutils package. Breaks non-interactive pipelines. Editor must be terminal-based.

HISTORY

vipe is part of moreutils by Joey Hess. It enables interactive editing within Unix pipelines.

SEE ALSO

vidir(1), sponge(1), tee(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community