diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2014-11-01 21:08:52 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2014-11-01 21:08:52 +0800 |
commit | 89d437817ed60d2b4c3e994fb33e2f759c80f624 (patch) | |
tree | 1a16e062620e758554f76160475a2f81fbebc879 /bash_include | |
parent | 8ec53caf0aba764581d92824ae2a7b4695848f35 (diff) | |
download | configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar.gz configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar.bz2 configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar.lz configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar.xz configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.tar.zst configfile-89d437817ed60d2b4c3e994fb33e2f759c80f624.zip |
bash_include: 刪除廢棄已久的舊版 PATH 編輯工具
Diffstat (limited to 'bash_include')
-rw-r--r-- | bash_include | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/bash_include b/bash_include index 47a0008..9675a76 100644 --- a/bash_include +++ b/bash_include @@ -857,139 +857,6 @@ function ldpath_editor () } -# Obsolete Group: Old PATH Editor ############################################ - -function split_path_core () -{ - echo "$current_path" | { - while read -d : oneline - do - [ '!' "$oneline" = '^' ] && echo "$oneline" - done - [ '!' "$oneline" = '^' ] && echo "$oneline" - } - unset oneline -} - -function split_path () -{ - coproc split_path_core - readarray -t -u ${COPROC[0]} patharr - wait $COPROC_PID -} - -function update_path () -{ - current_path='' - local -i i=0 - local firsttime="yes" - while [ "${patharr[$i]}" ] - do - if [ '!' "${patharr[$i]}" = "^" ] - then - if [ "$firsttime" ] - then - firsttime='' - else - current_path+=':' - fi - current_path+="${patharr[$i]}" - fi - i=$i+1 - done -} - -function old_path_editor_core () -{ - if [ "$1" = "ld" ] - then - export current_path="$LD_LIBRARY_PATH" - else - export current_path="$PATH" - fi - local should_continue="yes" - local command - local command_sub - local command_sub2 - local -i i - while [ "$should_continue" ] - do - split_path - i=0 - echo "========================================" - while [ "${patharr[$i]}" ] - do - echo "$i: ${patharr[$i]}" - i=$i+1 - done - [ "$i" = '0' ] && echo "(Empty or not declared)" - echo "========================================" - read -e -p "[A]ppend/(D)elete/(E)dit/(M)ove/(R)eset/(Q)uit ? " command - case "$command" in - ''|A|a) - read -e -p "Type a new entry: " patharr[$i] - update_path - ;; - D|d) - read -e -p "Index: " command_sub - patharr[$command_sub]='^' - update_path - ;; - E|e) - read -e -p "Index: " command_sub - read -e -p "Modify this entry: " -i "${patharr[$command_sub]}" patharr[$command_sub] - update_path - ;; - M|m) - read -e -p "From: " command_sub - read -e -p "To: " command_sub2 - swaptmp="${patharr[$command_sub]}" - patharr[$command_sub]="${patharr[$command_sub2]}" - patharr[$command_sub2]="$swaptmp" - unset swaptmp - update_path - ;; - R|r) - if [ "$1" = "ld" ] - then - current_path="$LD_LIBRARY_PATH" - else - current_path="$PATH" - fi - ;; - Q|q) - if [ "$1" = "ld" ] - then - export LD_LIBRARY_PATH="$current_path" - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - history -s "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - else - export PATH="$current_path" - echo "PATH=$PATH" - history -s "PATH=$PATH" - fi - should_continue='' - ;; - *) - printf " \e[33m*** Unknown command ***\e[m \n" - ;; - esac - done - unset patharr - unset current_path -} - -function old_path_editor () -{ - old_path_editor_core -} - -function old_ldpath_editor () -{ - old_path_editor_core ld -} - - # Group: Trash ############################################################### alias trash_put=trash_mv @@ -2022,19 +1889,6 @@ ENDHELPMSG done } -function help_obsolete () -{ - cat << "ENDHELPMSG" - @@@ Obsolete Group: PATH Editor @@@ - old_path_editor - old_ldpath_editor - x old_path_editor_core - x split_path - x split_path_core - x update_path -ENDHELPMSG -} - # Doing something |