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