Skip to content

Commit 48dab7f

Browse files
committed
Minor perf tune for bash
1 parent da3f33d commit 48dab7f

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

bash_profile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# ~/.bash_profile: executed by bash for login shells.
22

3+
# # This stuff is for performance tuning.
4+
# # See more: https://mdjnewman.me/2017/10/debugging-slow-bash-startup-files/
5+
#
6+
# # open file descriptor 5 such that anything written to /dev/fd/5
7+
# # is piped through ts and then to /tmp/timestamps
8+
# exec 5> >(ts -i "%.s" >> /tmp/timestamps)
9+
# # https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
10+
# export BASH_XTRACEFD="5"
11+
# # Enable tracing
12+
# set -x
13+
314
if [ -e ~/.bashrc ] ; then
415
. ~/.bashrc
516
fi

bashrc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ if [ `which rbenv 2> /dev/null` ]; then
3434
fi
3535

3636
# Node Package Manager
37-
if [ -d /usr/local/share/npm/bin ] ; then
38-
NODE_PATH="/usr/local/lib/node"
39-
PATH="${PATH}:/usr/local/share/npm/bin"
40-
fi
37+
# if [ -d /usr/local/share/npm/bin ] ; then
38+
# NODE_PATH="/usr/local/lib/node"
39+
# PATH="${PATH}:/usr/local/share/npm/bin"
40+
# fi
4141

4242
# MySql
43-
if [ -d /usr/local/mysql/bin ] ; then
44-
PATH="${PATH}:/usr/local/mysql/bin"
45-
fi
43+
# if [ -d /usr/local/mysql/bin ] ; then
44+
# PATH="${PATH}:/usr/local/mysql/bin"
45+
# fi
4646

4747
PATH=./bin:${PATH}
4848
PATH=.:${PATH}
@@ -107,7 +107,8 @@ fi
107107
# Do not set PS1 for dumb terminals
108108
if [ "$TERM" != 'dumb' ] && [ -n "$BASH" ]; then
109109
# export PS1='\[\033[32m\]\n[\s: \w] $(rvm_prompt) $(git_prompt)\n\[\033[31m\][\u@\h]\$ \[\033[00m\]'
110-
export PS1='\[\033[32m\]\n[\s: \w] $(git_prompt)\n\[\033[31m\][\u@\h]\$ \[\033[00m\]'
110+
# export PS1='\[\033[32m\]\n[\s: \w] $(git_prompt)\n\[\033[31m\][\u@\h]\$ \[\033[00m\]'
111+
export PS1='\[\033[32m\]\n[\s: \w]\n\[\033[31m\][\u@\h]\$ \[\033[00m\]'
111112
fi
112113

113114
############################################################
@@ -283,3 +284,7 @@ function gkill () {
283284
formatted_pname="[${pname:0:1}]${pname:1}"
284285
kill -9 $(ps aux | grep $formatted_pname | awk '{print $2}')
285286
}
287+
288+
export NVM_DIR="$HOME/.nvm"
289+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
290+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

0 commit comments

Comments
 (0)