#!/bin/sh
# source: https://www.mail-archive.com/tmda-users@tmda.net/msg06211.html
set -e
tmp=/tmp/seekable.$$
exec 3<&0 4<&1 >$tmp <$tmp
rm $tmp
cat <&3
exec ${1+"$@"} 1<&4 3>&- 4>&-
