# write stdin to a file.
sponge() {
  spongefile="$(createtemp 'file')"
  cat >"${spongefile:?}"
  cat -- "${spongefile:?}" >"${1:?}"
  rm -f -- "${spongefile:?}"
}
