fork(1) download
  1. import random
  2. import os
  3. import socket
  4.  
  5. contents=[]
  6.  
  7. with open("/etc/passwd") as rnd:
  8. for line in rnd:
  9. line=line.strip()
  10. contents.append(line)
  11. name = contents[random.randint(0,len(contents)-1)]
  12. rnd.close()
  13. name = "hostname -b "+name
  14.  
  15. print "Hostname:", name
Success #stdin #stdout 0.1s 11032KB
stdin
Standard input is empty
stdout
Hostname: hostname -b mail:x:8:8:mail:/var/mail:/bin/sh