diff options
author | LAN-TW <lantw44@gmail.com> | 2012-11-10 23:48:55 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2012-11-10 23:48:55 +0800 |
commit | 48747c66f9a973da4a2a381e07eb2f20a65b9370 (patch) | |
tree | d62f0c90048621a4bb0e51e7de344c5fd3ad1277 /bash_include | |
parent | 3ed43d8be2d3f36952eedf764aabd74757c2d227 (diff) | |
download | configfile-48747c66f9a973da4a2a381e07eb2f20a65b9370.tar.gz configfile-48747c66f9a973da4a2a381e07eb2f20a65b9370.tar.zst configfile-48747c66f9a973da4a2a381e07eb2f20a65b9370.zip |
bash_include: 互動式編輯普通變數bash_include-20121110
Diffstat (limited to 'bash_include')
-rw-r--r-- | bash_include | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bash_include b/bash_include index e269e8d..09fed02 100644 --- a/bash_include +++ b/bash_include @@ -911,6 +911,19 @@ function path_editor () ########## New PATH Editor End ########## +function varset () +{ + local varoldvalue + local varnewvalue + while [ "$1" ] + do + eval varoldvalue=\${$1} + read -r -e -p "$1=" -i "$varoldvalue" varnewvalue + eval $1=\"$varnewvalue\" + shift + done +} + function backup_file () { split_arguments "$@" @@ -1148,6 +1161,7 @@ function help_function () mvfile [-n] filenames ... [-- sudo_prefix] prehistory_backup set_console_title + var_set variables ... x createdir_askmode dirname x split_arguments [arguments ...] x get_file_size filename [-- sudo_prefix] |