chiark
/
gitweb
/
~mdw
/
misc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
space.[c1]: Document the `-v' option finally.
[misc]
/
buf
1
#! /bin/sh
2
3
set -e
4
case "$#:$1" in
5
0:* | 1:-h | 1:--help)
6
echo "Usage: $0 PROG ARGS..."
7
echo " Buffer stdin to temp file and pass to PROG with ARGS"
8
exit 0
9
;;
10
esac
11
tmp=${TMPDIR-/tmp}/buf-$$
12
mkdir "$tmp"
13
trap 'rm -rf "$tmp"' INT QUIT TERM HUP EXIT
14
cat >"$tmp/buf"
15
set +e; "$@" "$tmp/buf"; st=$?; set -e
16
trap '' INT QUIT TERM HUP EXIT
17
rm -rf "$tmp"
18
exit $st