view bin/rng @ 2320:da776ff681e5

<Jafet> (echo \'#!/bin/sh\'; echo \'a() { p=$(echo -n $(ps -p $1 -oppid | tail -1)); if ps -p $p -ocmd | tail -1 | egrep " \\| cat\\$"; then ps -p $1 -ocmd | tail -1; else a $p; fi }\'; echo \'a $$\') > bin/quine2 && quine2 a b c
author HackBot
date Fri, 01 Mar 2013 02:07:19 +0000
parents c096bb536bb2
children
line wrap: on
line source

#!/usr/bin/env lua

math.randomseed(os.time())
W={}
for i,a in ipairs(arg) do
   for w in a:gmatch("[^%s]+") do
      table.insert(W, w)
   end
end
if #W>0 then
   print(W[math.random(#W)])
end