Ticket #10747 (closed defect: fixed)
%_uptime: Output differs depending on number of users logged in
| Reported by: | Skyrazer | Owned by: | nobody |
|---|---|---|---|
| Milestone: | Adium 1.4 | Component: | Adium Core |
| Version: | 1.3b11 | Severity: | normal |
| Keywords: | uptime script users | Cc: | |
| Patch Status: |
Description
The output of the script %_uptime works quite strange. When only 1 user is logged in it outputs something like this:
4 days, 1:23, 1 user, load averages: 0.06 0.11 0.10
else it outputs
4 days, 1:23
Attachments
Change History
comment:1 in reply to: ↑ description Changed 4 years ago by zevlag
The bug is in the uptime script, it runs this command: "/usr/bin/uptime | /usr/bin/awk -F'up[ ]+|, [0-9]+ users' '{print $2}'"
The issue is with the awk parsing, it is looking for "users", when there is only one, it says "user". I have to run, I'll see if I can test a fix later.
Replying to Skyrazer:
The output of the script %_uptime works quite strange. When only 1 user is logged in it outputs something like this:
4 days, 1:23, 1 user, load averages: 0.06 0.11 0.10else it outputs
4 days, 1:23
comment:2 Changed 4 years ago by jas8522
- Owner nobody deleted
- Component changed from Adium Core to Internal Scripts / Build Process
- Milestone set to Adium 1.3.x
comment:3 Changed 4 years ago by cbarrett
Is this really the right component for this? Seems like this is for build scripts or helper scripts, not things like %_uptime.
comment:4 Changed 4 years ago by zevlag
This should be the code in the uptime script. It will solve the problem. I fixed it, then searched around and found it had also been fixed in the Uptime.3.scpt of ticket #2734. But never applied to the release versions.
return do shell script "/usr/bin/uptime | /usr/bin/awk -F'up[ ]+|, [0-9]+ user[s]*' '{print $2}'" as string
comment:5 Changed 4 years ago by jas8522
- Milestone changed from Adium 1.3.x to Adium 1.3.3
cbarrett: I thought it might be more specific than something like "Adium Core" in order to help identify what the ticket refers to when glancing at a milestone. Technically it is an internal script, but I can see what you mean. Perhaps those should be separate components - Build Process and Internal Scripts.
comment:6 Changed 4 years ago by cbarrett
- Owner set to nobody
- Component changed from Internal Scripts / Build Process to Adium Core
jas8522: I think internal in this case means not part of Adium but internal to the Adium project.
comment:8 Changed 3 years ago by Stephen Holt <sholt@…>
- Status changed from new to closed
- Resolution set to fixed
(In 49e9f62a5292) Correcting awk regexp for single users. Fixes #10747. (transplanted from d063b5446352c580bb0ba9eda3e033136b56e4d7)
comment:9 Changed 3 years ago by Stephen Holt <sholt@…>
(In d063b5446352) Correcting awk regexp for single users. Fixes #10747.


