Skip to content

Instantly share code, notes, and snippets.

@rlespinasse
Created April 17, 2018 20:21
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 rlespinasse/2c266aeea6089cdd1dba2558fbf90258 to your computer and use it in GitHub Desktop.
Save rlespinasse/2c266aeea6089cdd1dba2558fbf90258 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Initialize applicative variables
dirname=$(dirname "$(greadlink -f "$0")")
basename=$(basename "$0")
filename=${basename%.*}
logdir=${dirname}
logfile=${filename}.log
exec &> >(tee -a "${logdir}/${logfile}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment