On 2017-01-03 at 12:38, Johan DS wrote: > Hi > I use the who command in my .zlogin for counting how many times I'm logged > in. > who | awk '$1 == "'$USER'"' | wc -l > > previously the output was something like > user tty1 > user pts/2 > so user was 2 times logged in
The output from which part of the command? The output I get from this command is a single number. If I drop the '| wc -l' from the end, the output I get appears to be exactly the same as the output from just running 'who' by itself. > However the who output seems to be changed in: > > NAME LINE TIME IDLE PID COMMENT EXIT > system boot 2017-01-03 15:56 > user - tty1 2017-01-03 15:58 01:52 1067 > run-level 5 2017-01-03 15:59 > pts/2 2017-01-03 17:22 14868 id=ts/2 term=0 > exit=0 I don't get this. What version of who are you running? That is: * What does 'who --version' say? * What does 'apt-cache policy coreutils' say? (who is normally part of coreutils.) On my system: $ type who who is /usr/bin/who $ dlocate /usr/bin/who | grep /who$ coreutils: /usr/bin/who $ who --version who (GNU coreutils) 8.26 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Joseph Arceneaux, David MacKenzie, and Michael Stone. $ apt-cache policy coreutils coreutils: Installed: 8.26-1 Candidate: 8.26-1 Version table: *** 8.26-1 500 500 http://ftp.us.debian.org/debian testing/main amd64 Packages 100 /var/lib/dpkg/status 8.23-4 500 500 http://ftp.us.debian.org/debian stable/main amd64 Package > Does anybody knows an alternative so I can count my loggins again The first thing to do is figure out what changed and why. Once we know that, we can start pursuing ways to find something that will work now. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature