On Fri, Mar 20, 2020 at 01:44:22PM +0100, Alex Naumov wrote: > this patch adds a new option to uptime(1) that allows to see the length of > time the system has been up in seconds.
Please don't. Both uptime(1) and w(1) has had several options removed over the past - cleaning, simplyfying and reducing their codebases significantly - and adding options back just to satisfy some more or less ad-hoc need for scripting purposes seems like a bad idea to me. Besides that - the output would still need to be parsed. Regards, Erling > Patch includes documentation (man-page) update. > > Example: > $ uptime > 1:26PM up 1:28, 1 user, load averages: 0.00, 0.00, 0.00 > $ uptime -S > 1:26PM 5308 secs, 1 user, load averages: 0.00, 0.00, 0.00 > > It's tested in current on amd64 and aarch64. > > Why I need it? Well, it makes it easy to check the time the system has been > up, for example, via scripts. It doesn't need to parse the output and > recalculate it. > > Cheers, > Alexander
