Date created: 03/12/21 08:21:05. Last modified: 03/12/21 08:38:30

Bash Profile

#
# Linux specific here...
#
if [[ "$OSTYPE" == "linux-gnu"* ]]; then



#
# Mac OS specific here...
#
elif [[ "$OSTYPE" == "darwin"* ]]; then

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"

# fff file manager
PATH="/Users/jby30/Scripts/Bash/fff:${PATH}"

# Brew sudo apps are installed here:
PATH="/usr/local/sbin:${PATH}"

# For brew/get_iplayer
PATH="/usr/local/opt/tcl-tk/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/tcl-tk/lib"
export CPPFLAGS="-I/usr/local/opt/tcl-tk/include"
export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig"

export PATH

fi



#
# All generic OS stuff here...
#

# append to the history file, don't overwrite it
shopt -s histappend
export HISTCONTROL=ignoredups:ignorespace
export HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S '
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
export HISTSIZE=100000
export HISTFILESIZE=100000


# Format the prompt string as follows:
# username@hostname [current date and time] (current dir)
# This also changes the colour of the bash prompt to reflect the exit status of the last command run,
# and drops the prompt down to a new line to separate the prompt from the command being run:
PS1='`
if [ $? -eq 0 ];
then echo -n "\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\])\n\$";
else echo -n "\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\])\n\$";
fi`\[\033[0m\]'

# The result is:
bensley@ubuntu-laptop [2021-03-12 09:27:07] (~)
$ ls -l

Previous page: 'apt' & 'dpkg' Notes
Next page: CIFS/SMB Notes