changeset 2325:4f9fbae64db7

<Jafet> (echo \'#!/bin/sh\'; echo \'a() { p=$(echo -n $(ps -p $1 -oppid | tail -1)); if ps -p $p -ocmd | tail -1 | egrep -q " \\| cat\\$"; then ps -p $1 -ocmd | tail -1; else a $p; fi }\'; echo \'q=$(a $$); echo -n "$q" | hd; if echo "$q" | grep -q "^bash -c"; then echo "$q" | sed "s/^bash -c/`run/"; elif echo "$q" | grep -q "^/bin/sh"; then echo "$q" | sed "s,^/bin/sh,`,"; else echo \\`"$q"; fi\') > bin/quine2
author HackBot
date Fri, 01 Mar 2013 02:19:30 +0000
parents 90fbdeee6dc0
children 3f8c4de90983
files bin/quine2
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/quine2	Fri Mar 01 02:17:53 2013 +0000
+++ b/bin/quine2	Fri Mar 01 02:19:30 2013 +0000
@@ -1,3 +1,3 @@
 #!/bin/sh
 a() { p=$(echo -n $(ps -p $1 -oppid | tail -1)); if ps -p $p -ocmd | tail -1 | egrep -q " \| cat\$"; then ps -p $1 -ocmd | tail -1; else a $p; fi }
-q=$(a $$); echo "$q"; 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
+q=$(a $$); echo -n "$q" | hd; if echo "$q" | grep -q "^bash -c"; then echo "$q" | sed "s/^bash -c/`run/"; elif echo "$q" | grep -q "^/bin/sh"; then echo "$q" | sed "s,^/bin/sh,`,"; else echo \`"$q"; fi