I'm a Bash Newbie, hope you guys can help.
n.n
Ok, So I need to make a script that will get a list of the Users that are/have logged in (recently).
I've been wondering how to get it with either the
last or the
who command.
This Poses a problem, as with
who, it ONLY shows the Users Currently logged in, and I need to get users that have recently logged out (Including the time they stayed connected).
So that leaves me the
last command, the one I've been using, However, it's giving me quite the problem to display ONLY recent connections. I know about -t, but apparently it shows the connections since the start of the log up to the timeframe set.
Also, When I get that working, What if a user currently logged in has been connected longer than the timeframe I set? Or what if someone has logged in and logged out? It only needs to be displayed once.
Should I go back and try with
who?
Some Expert who could lend me a hand? Please Linux/Unix masters! u.u
I would appreciate it a lot.
I've been trying some hours into this, but to no avail.