view bin/quine2 @ 4058:d6a049bf90e4

<mrhmouse> echo "(function(){var e,l,o,t;t=process.argv[2],(null!=t?t.length:void 0)||(console.log(\'Usage: ello <name>\'),process.exit()),o=/(.*)(e)$/i,e=/(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i,l=/[bcdfghjklmnpqrstvwxz]/i,console.log(e.test(t)?t.replace(e,function(e,l,o,t){return l+o+\'ell\'+t}):o.test(t)?t.replace(o,function(e,l){return l+\'ello\'}):l.test(t)?t+\'ello\':\'Hello, \'+t+\'!\')}).call(this);" >> bin/ello
author HackBot
date Fri, 22 Nov 2013 15:58:10 +0000
parents f2f65a1fa363
children
line wrap: on
line source

#!/bin/sh
a() { p=$(echo -n $(ps -p $1 -oppid | tail -1)); if ps -p $p -ocmd | tail -1 | egrep -q "^sh -c .* \| cat\$"; then ps -p $1 -ocmd | tail -1; else a $p; fi }
q=$(a $$); if echo "$q" | grep -q "^bash -c"; then echo "$q" | sed "s/^bash -c/\`run/"; elif echo "$q" | grep -q "^/bin/sh /hackenv/bin/"; then echo "$q" | sed "s,^/bin/sh /hackenv/bin/,\`,"; else echo \`"$q"; fi