Skip to content

Instantly share code, notes, and snippets.

@berdario
Last active October 12, 2016 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berdario/da882abe5ba77533edf7f43872b8b80e to your computer and use it in GitHub Desktop.
Save berdario/da882abe5ba77533edf7f43872b8b80e to your computer and use it in GitHub Desktop.
How to write to a file in bash without reopening the file multiple times
exec 3> /tmp/foo
echo "1" >&3
echo "2" >&3
exec 3>&-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment