#!/bin/sh
#
# vipe: use your $EDITOR to edit text in pipelines.
#
# write all data to a temporary file, edit that file, then print it again.

tmp=$(mktemp)
trap 'rm -f "$tmp"' 0

cat >"${tmp}"
${EDITOR:-vim} "${tmp}" </dev/tty >/dev/tty
cat "${tmp}"
