From 06d74a3667bd32129f3c806edc95faa4354d8a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 6 Apr 2022 10:10:05 +0200 Subject: [PATCH] default is $USER or user is first argument --- bin/lastlocallogins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/lastlocallogins b/bin/lastlocallogins index 2eb563d..ecec804 100755 --- a/bin/lastlocallogins +++ b/bin/lastlocallogins @@ -4,10 +4,10 @@ F="$(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f cat << EOF ----- Alle Tage mit lokalen Logins -User: $USER +User: ${1:-$USER} Host: $(hostname) Files: $F ----- 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