function log { typeset -i stat=$? typeset x x=$(fc -ln -0) logger -p daemon.notice -t "ksh $LOGNAME $$" Status $stat PWD $PWD \'${x# }\' } trap log DEBUG |
Jun 11 10:13:23 birdie ksh
root 4008: [ID 702911 daemon.notice] Status 0 PWD /etc ' cd /etc' Jun 11 10:13:23 birdie ksh root 4008: [ID 702911 daemon.notice] Status 0 PWD /etc ' ls' Jun 11 10:13:28 birdie ksh root 4008: [ID 702911 daemon.notice] Status 0 PWD /etc ' cat /etc/passwd' |
function log { typeset x x=$(history 1 | cut -f 5-) logger -p daemon.info -t "$LOGNAME" $PWD ${x# } } trap log DEBUG |
Aug 25 09:40:50 doggie
root: [ID 702911 daemon.info] / 501 pwd Aug 25 09:40:59 doggie root: [ID 702911 daemon.info] / 502 ps -ef|grep bob|grep sh |
function log { typeset x x=$(history 1 | cut -f 5-) logger -p daemon.notice -t "$LOGNAME" $PWD "${x# }" } trap log DEBUG |
nohup /bin/ksh
/usr/local/bin/log.sh & |
trap '. /.sh_logout; exit'
0 |
BSE=/tmp touch $BSE/lck.file cat /.sh_history | strings -n 1 > $BSE/one while [ -f $BSE/lck.file ] do sleep 10 cat /.sh_history | strings -n 1 > $BSE/two diff $BSE/one $BSE/two | grep ">" | cut -c 2- > $BSE/gosyslog logger -p daemon.notice -t "root_profile" -f $BSE/gosyslog mv $BSE/two $BSE/one done |
clear if [ -f /tmp/lck.file ] then rm -rf /tmp/lck.file rm -rf /nohup.out fi |
function log { echo ""; } ; trap log DEBUG |
export HISTSIZE=0 |