From e3dd04a0babb3969cc7aaa9adf4e454e744c93fe Mon Sep 17 00:00:00 2001 From: wzj <244142824@qq.com> Date: Tue, 13 Dec 2022 14:57:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'newset.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- newset.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/newset.sh b/newset.sh index 1b2e9f7..9b35e19 100644 --- a/newset.sh +++ b/newset.sh @@ -78,24 +78,24 @@ cat>>/etc/profile</dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` -if [ "$USER_IP" = "" ] +if [ "\$USER_IP" = "" ] then -USER_IP=`hostname` +USER_IP=\`hostname\` fi if [ ! -d /var/log/history ] then mkdir -p /var/log/history chmod 777 /var/log/history fi -if [ ! -d /var/log/history/${LOGNAME} ] +if [ ! -d /var/log/history/\${LOGNAME} ] then -mkdir -p /var/log/history/${LOGNAME} -chmod 300 /var/log/history/${LOGNAME} +mkdir -p /var/log/history/\${LOGNAME} +chmod 300 /var/log/history/\${LOGNAME} fi export HISTSIZE=4096 -DT=`date "+%Y-%m-%d_%H:%M:%S"` -export HISTFILE="/var/log/history/${LOGNAME}/${USER_IP}-log.$DT" -chmod 600 /var/log/history/${LOGNAME}/*log* 2>/dev/null +DT=\`date "+%Y-%m-%d_%H:%M:%S"\` +export HISTFILE="/var/log/history/\${LOGNAME}/\${USER_IP}-log.$DT" +chmod 600 /var/log/history/\${LOGNAME}/*log* 2>/dev/null ######################代码结束####################### EOF }