sweetlilmre
Member
- Joined
- Jan 14, 2006
- Messages
- 92
Hi,
Thank you Notaz!
The issue on my machine is that:
produces:
which results in the su call logging:
This seems to be related to this: 'bug' or rather aspect of ps
i.e. usernames that are longer than 8 characters are displayed as an ID and hence why this only effects some users.
replacing the code with:
Seems to do the trick (at least in a shell), though I am sure a shell ninja will laugh at that and produce something more elegant
-(e)
[edit: changed name length to saner 20 and tested the command, it seems to work!]
Thank you Notaz!
The issue on my machine is that:
Code:
ps u -C xfce4-session | tail -n1 | awk '{print $1}'
produces:
Code:
1000
which results in the su call logging:
Code:
Unknown id: 1000
This seems to be related to this: 'bug' or rather aspect of ps
i.e. usernames that are longer than 8 characters are displayed as an ID and hence why this only effects some users.
replacing the code with:
Code:
ps -eo user:20,comm | grep "xfce4-session" | tail -n1 | awk '{print $1}'
Seems to do the trick (at least in a shell), though I am sure a shell ninja will laugh at that and produce something more elegant
-(e)
[edit: changed name length to saner 20 and tested the command, it seems to work!]
Last edited by a moderator: