default is $USER or user is first argument

This commit is contained in:
Jakobus Schürz 2022-04-06 10:10:05 +02:00
parent cdedae5d6d
commit 06d74a3667

View file

@ -4,10 +4,10 @@ F="$(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f
cat << EOF cat << EOF
----- -----
Alle Tage mit lokalen Logins Alle Tage mit lokalen Logins
User: $USER User: ${1:-$USER}
Host: $(hostname) Host: $(hostname)
Files: $F Files: $F
----- -----
EOF EOF
last -F -a $F |grep -v "pts/\|reboot\|wtmp"|awk '$1 == u {print $4,$5,$7}' u=$USER|uniq last -w -F -a $F |grep -v "pts/\|reboot\|wtmp"|awk '$1 == u {print $4,$5,$7}' u=${1:-$USER}|uniq