diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2015-02-01 18:02:24 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2015-02-01 18:02:24 +0800 |
commit | e4b35c5a225209e51fc9cef2762b3714cf0604be (patch) | |
tree | 23e48570acb67213497dde5567c500b0fb6d3107 /bash_include | |
parent | a7db9383f537a3f9b58f3925e91626037ca0cecb (diff) | |
download | configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar.gz configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar.bz2 configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar.lz configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar.xz configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.tar.zst configfile-e4b35c5a225209e51fc9cef2762b3714cf0604be.zip |
bash_include: varset 加入 -p 用於輸入密碼bash_include-20150201
Diffstat (limited to 'bash_include')
-rw-r--r-- | bash_include | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bash_include b/bash_include index 936f7da..bb7f87b 100644 --- a/bash_include +++ b/bash_include @@ -1340,10 +1340,15 @@ function varset () { local varoldvalue local varnewvalue + local noecho + if [ "$1" = "-p" ]; then + noecho="-s" + shift + fi while [ "$1" ] do eval varoldvalue=\${$1} - read -r -e -p "$1=" -i "$varoldvalue" varnewvalue + read -r -e -p "$1=" -i "$varoldvalue" $noecho varnewvalue eval "$1"='"$varnewvalue"' shift done @@ -1925,7 +1930,7 @@ function help_function () <<< Tools: Interactive >>> editlink filenames ... [-- sudo_prefix ...] mvfile [-n] filenames ... [-- sudo_prefix ...] - varset variables ... + varset [-p] variables ... <<< Tools: Memory >>> get_memory_info |