File tree 4 files changed +31
-4
lines changed
4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ env_var_name=$1
4
+
5
+ old_IFS=" $IFS "
6
+ IFS=' :'
7
+ read -ra path_array <<< " ${!env_var_name}"
8
+ IFS=" $old_IFS "
9
+
10
+ declare -A unique_paths
11
+ unique_path_array=()
12
+
13
+ for path in " ${path_array[@]} " ; do
14
+ if [ -z " ${unique_paths[$path]} " ]; then
15
+ unique_paths[$path ]=1
16
+ unique_path_array+=(" $path " )
17
+ fi
18
+ done
19
+
20
+ new_env_var=$( IFS=' :' ; echo " ${unique_path_array[*]} " )
21
+
22
+ echo " $new_env_var "
Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ alias rm-rf='rm -rf'
45
45
alias rm-tags=' rm -f cscope.* ncscope.* tags'
46
46
47
47
# rc aliases
48
- alias so=" . ${PROFILE} "
48
+ alias uniqueify=" /bin/bash --noprofile --norc $ENV_ROOT /bin/uniq-path.sh"
49
+ alias uniqueify_PATH=" export PATH=` uniqueify PATH` "
50
+ alias uniqueify_LD_LIBRARY_PATH=" export LD_LIBRARY_PATH=` uniqueify LD_LIBRARY_PATH` "
51
+ alias so=" . ${PROFILE} ; sleep 1; uniqueify_PATH; uniqueify_LD_LIBRARY_PATH;"
49
52
alias so.tmux=" tmux source $HOME /.tmux.conf"
50
53
alias shrc=" vim ${PROFILE} "
51
54
alias vimrc=" vim $HOME /.vimrc"
Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ alias rm-rf 'rm -rf'
46
46
alias rm-tags ' rm -f cscope.* ncscope.* tags'
47
47
48
48
# rc aliases
49
- alias so " source ${PROFILE} "
49
+ alias uniqueify " /bin/bash --noprofile --norc $ENV_ROOT /bin/uniq-path.sh"
50
+ alias uniqueify_PATH " export PATH=` uniqueify PATH` "
51
+ alias uniqueify_LD_LIBRARY_PATH " export LD_LIBRARY_PATH=` uniqueify LD_LIBRARY_PATH` "
52
+ alias so " . ${PROFILE} ; sleep 1; uniqueify_PATH; uniqueify_LD_LIBRARY_PATH;"
50
53
alias shrc " vim ${PROFILE} "
51
54
alias vimrc " vim ~/.vimrc"
52
55
alias gvimrc " gvim ~/.gvimrc"
Original file line number Diff line number Diff line change 1
- # common
1
+ # common
2
2
source $ENV_ROOT /inc/base.sh
3
3
# core
4
4
source $ENV_ROOT /inc/bash/variables.bash
25
25
source $ENV_ROOT /inc/rdp-remote.sh
26
26
source $ENV_ROOT /inc/docker.sh
27
27
source $ENV_ROOT /inc/launcher.sh
28
- source $ENV_ROOT /inc/settings.sh
29
28
source $ENV_ROOT /inc/production.sh
30
29
source $ENV_ROOT /inc/pdf.sh
You can’t perform that action at this time.
0 commit comments