-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemp_bashrc_content.sh
More file actions
39 lines (33 loc) · 1.2 KB
/
temp_bashrc_content.sh
File metadata and controls
39 lines (33 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (the "EXAMPLES" section)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
histcontrol=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
histsize=1000
# NVM Sourcing
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Prioritize Linux paths and filter out Windows paths
if [ -n "$PATH" ]; then
NEW_PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
if [ -d "$HOME/.cargo/bin" ]; then
NEW_PATH="$HOME/.cargo/bin:$NEW_PATH"
fi
IFS=":" read -ra PATH_ARRAY <<< "$PATH"
for p in "${PATH_ARRAY[@]}" ; do
if [[ ! "$p" =~ ^/mnt/ ]] && [[ ! ":$NEW_PATH:" =~ ":$p:" ]]; then
NEW_PATH="$NEW_PATH:$p"
fi
done
export PATH="$NEW_PATH"
fi