This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect stdout and stderr to tee. Append all to logFile | |
# and leave on standard streams. | |
logFile="foo.log" | |
exec > >(tee -a "${logFile}") | |
exec 2> >(tee -a "${logFile}" >&2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# addToPATH funciton for adding a directory to PATH. | |
# Prevents duplicate entries and ensures directory exists. | |
# $1 = Directory to add to PATH | |
addToPATH(){ | |
if [ -d "${1}" ]; then | |
case ":${PATH}:" in | |
*":${1}:"*);; #Directory already in PATH | |
*) PATH="${PATH}:${1}";; #Append directory to PATH | |
esac | |
fi |