Date created: 12/17/19 09:12:00. Last modified: 05/17/20 10:57:13

Mac BASH Profile

 

$cat .bash_profile

shopt -s histappend
export HISTCONTROL=ignoredups:ignorespace
export HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S '
export HISTSIZE=100000
export HISTFILESIZE=100000

# Custom prompt string
PS1='`
if [ $? -eq 0 ];
then echo -n "\[\e[00;30m\]\u\[\e[01;32m\]@\[\e[00;30m\]\h \[\e[01;32m\][\[\e[00;30m\]\D{%F %T}\[\e[01;32m\]] (\[\e[00;30m\]\W\[\e[01;32m\])\$";
else echo -n "\[\e[00;30m\]\u\[\e[01;31m\]@\[\e[00;30m\]\h \[\e[01;31m\][\[\e[00;30m\]\D{%F %T}\[\e[01;31m\]] (\[\e[00;30m\]\W\[\e[01;31m\])\$";
fi`\[\033[0m\]'


# Mac specific commands/aliases
alias cls='printf "\33c\e[3J"'


# gdate comes from "brew install coreutils"
logDir="$HOME/.ssh/logs/`date +'%Y-%m'`/"
mkdir -p $logDir