Skip to content

Instantly share code, notes, and snippets.

@ktbarrett
Created July 29, 2022 04:25
Show Gist options
  • Save ktbarrett/252e49828a84582e35b6a403b224ada7 to your computer and use it in GitHub Desktop.
Save ktbarrett/252e49828a84582e35b6a403b224ada7 to your computer and use it in GitHub Desktop.
Like tee, but just on stderr
function logerr {
file="$1"
shift 1
"$@" 2> >(tee "$file" >&2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment