From e090b06726a7b5f39e21eb99ed4616baae2d3874 Mon Sep 17 00:00:00 2001 From: wzj <244142824@qq.com> Date: Thu, 5 Jan 2023 17:22:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86PS1=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- newset.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newset.sh b/newset.sh index 1eaac80..e5c4dee 100644 --- a/newset.sh +++ b/newset.sh @@ -77,7 +77,7 @@ cat>>/etc/profile</dev/null| awk '{print $NF}'|sed -e 's/[()]//g'\` +USER_IP=\`who -u am i 2>/dev/null| awk '{print \$NF}'|sed -e 's/[()]//g'\` if [ "\$USER_IP" = "" ] then USER_IP=\`hostname\` @@ -94,7 +94,7 @@ 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" +export HISTFILE="/var/log/history/\${LOGNAME}/\${USER_IP}-log.\${DT}" chmod 600 /var/log/history/\${LOGNAME}/*log* 2>/dev/null ######################代码结束####################### EOF