Skip to content

Instantly share code, notes, and snippets.

@darkxanter
Created December 8, 2015 09:38
Show Gist options
  • Save darkxanter/d3c1a519ac6593746306 to your computer and use it in GitHub Desktop.
Save darkxanter/d3c1a519ac6593746306 to your computer and use it in GitHub Desktop.
redirect both standard output and standard error of all commands in a bash script
#!/bin/bash
logfile=$$.log
exec > $logfile 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment