aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-11-02 23:57:58 +0800
committerLAN-TW <lantw44@gmail.com>2013-11-02 23:57:58 +0800
commit14a1de8d84615c8e4d9f15cbed3f1db3037e94cd (patch)
tree6db128bbb285c733f6e2521878d83c54240c2817
parent74b58a40bd0ef6a1b884b551b2391ef126396e93 (diff)
downloadconfigfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar.gz
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar.bz2
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar.lz
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar.xz
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.tar.zst
configfile-14a1de8d84615c8e4d9f15cbed3f1db3037e94cd.zip
bash_include: 修正 configfile_initial_setup 和 varset 的問題bash_include-20131103
-rw-r--r--bash_include17
1 files changed, 12 insertions, 5 deletions
diff --git a/bash_include b/bash_include
index ce2b09f..06e8adc 100644
--- a/bash_include
+++ b/bash_include
@@ -997,13 +997,13 @@ function configfile_fetch ()
function configfile_initial_setup ()
{
- cat >> ~/.bashrc << EOF
+ cat >> ~/.bashrc << "EOF"
if [ -f ~/.bash_include ]; then
. ~/.bash_include
fi
EOF
if [ "`uname`" = "FreeBSD" ]; then
- cat >> ~/.bash_login << EOF
+ cat >> ~/.bash_login << "EOF"
GET_TTY_NAME=`tty | cut -c 9`
[ "$GET_TTY_NAME" = 'v' ] && echo "Login from local virtual terminal: `tty`"
[ "$GET_TTY_NAME" = 'p' ] && echo "Login from pseudo terminal: `tty`"
@@ -1011,11 +1011,18 @@ GET_TTY_NAME=`tty | cut -c 9`
unset GET_TTY_NAME
EOF
fi
- cat >> ~/.bash_login << EOF
-if [ -f ~/.bash_include ]; then
+ cat >> ~/.bash_login << "EOF"
+if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
EOF
+ echo "Completed. Type \`help_function' to know how to use!"
+ for i in ~/.bashrc ~/.bash_login ~/.bash_profile ~/.shrc ~/.profile
+ do
+ grep -q -e HISTSIZE -e HISTFILESIZE "$i" 2>/dev/null && \
+ echo "Warning: HISTSIZE or HISTFILESIZE is set in $i!" && \
+ echo "History file features may not work"
+ done
}
function fetch_remote_file ()
@@ -1113,7 +1120,7 @@ function varset ()
do
eval varoldvalue=\${$1}
read -r -e -p "$1=" -i "$varoldvalue" varnewvalue
- eval $1=\"$varnewvalue\"
+ eval "$1"='"$varnewvalue"'
shift
done
}