Closed HenrikBengtsson closed 7 years ago
This is because c4 head
loops only over usernames:
for user in ${users[@]}; do
res=$(printf '%s\n' "${bfr[@]}" | grep "$user " | grep -v "grep -E \"$user \"")
To fix this, we need to also translate username to UID and then include processes using also grep UID.
What about just grep’ing for any UID that is greater than 500? No need for the script to translate, we can do that manually if necessary.
It would require a modified loop iterator, because it's currently looping over known usernames (see link to code); it would also have to loop over known UID. Doable, but it wouldn't group UIDs with known users and we would still have to look up the user information somehow via finger
.
Forgot to say, I don't think it's that hard to map UID to username and vice versa. So, I should be able to a this feature soon-ish.
Fixed using id -u $user
, cf. https://github.com/UCSF-CBC/TIPCC-Tools/blob/master/cbc/shared/bin/c4#L171-L172
@jjed, wrote: