aboutsummaryrefslogtreecommitdiff
path: root/vp
blob: 88bfdf9c7e708170032481d54a1c7c2c49e5ad91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

VPIN=
if [ ! -t 0 ]; then
	VPIN=`mktemp`
	cat > "$VPIN"
fi
export VPIN

f=`mktemp`
</dev/tty >/dev/tty vi +':so /usr/local/etc/vprc' "$@" "$f"
[ "$(wc -c "$f" | awk '{print $1}')" -eq 0 ] && rm "$f"

if [ ! -z "$VPIN" ]; then
	cat "$VPIN"
	rm "$VPIN"
fi