changeset 12141:bbcac610574d draft

<b_jonas> fetch /hackenv/bin/uptime https://hack.esolangs.org/get/bin/uptime
author HackEso <hackeso@esolangs.org>
date Sun, 17 Nov 2019 20:17:51 +0000
parents 2826c0c87d92
children ec79f376cd1a
files bin/uptime
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bin/uptime	Sun Nov 17 20:11:40 2019 +0000
+++ b/bin/uptime	Sun Nov 17 20:17:51 2019 +0000
@@ -1,6 +1,6 @@
-#!/usr/bin/python3
+#!python3
 boottime = 1245511822
-import sys, time
+import sys, os, time
 helpmsg = "\nUsage:\n uptime [options]\n\nOptions:\n -p, --pretty   show uptime in pretty format\n -h, --help     display this help and exit\n -s, --since    system up since\n -V, --version  output version information and exit\n\nFor more details see uptime(1)."
 opt_p, opt_s = 0, 0
 for a in sys.argv[1:]:
@@ -13,7 +13,8 @@
             elif "s" == c:
                 opt_s = 1
             elif "V" == c:
-                print("uptime from procps-ng 3.3.15")
+                os.execl("/usr/bin/uptime", "/usr/bin/uptime", "-V")
+                print("uptime from procps-ng 2.95.1")
                 sys.exit(0)
             elif "h" == c:
                 print(helpmsg, file = sys.stdout)