As for the shell script to track the inputs/outputs of the users in the system with indication of operation time and number of the terminal?

As for the shell script to track the inputs/outputs of the users in the system with indication of operation time and number of the terminal?

The algorithm I like and clear:
1) written to the user file, the terminal number and time
2) Compare the 2 minutes via current user And number of the terminal, if the same then increase the arrival time in the file and otherwise complete the last. session and recording the new..?

I the shell script are not familiar, please do not throw tomatoes :(
June 10th 19 at 14:20
2 answers
June 10th 19 at 14:22
Solution
Hi,
The inputs and outputs of users are logged at the kernel level and written to a log, so keep track of the time of entry, exit, and the amount of time for the session without any shell scripts, command last.

And what does "otherwise we finish last. session"? You want time to limit the work in the terminal?
Good evening, thanks for the solution
No I don't want a time limit :)
I mean that will place a marker in the file that the user has ended :) - leonardo_Schuster13 commented on June 10th 19 at 14:25
mark solution - Donald.Rolfson commented on June 10th 19 at 14:28
June 10th 19 at 14:24
There is an assumption that You came up with something between w, who and last. Read about wtmp/utmp - of vozmojno will cost a parser.
There is also speculation that this is another shkolota knocks out your puzzles. Because in real life no one puts a limitation such as "this is to be done on /bin/sh"

Find more questions by tags TerminalProgrammingLinux