Mercurial > repo
changeset 2324:90fbdeee6dc0
<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 "$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\') > bin/quine2
author | HackBot |
---|---|
date | Fri, 01 Mar 2013 02:17:53 +0000 |
parents | 63c3c407dbae |
children | 4f9fbae64db7 |
files | bin/quine2 |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/quine2 Fri Mar 01 02:15:53 2013 +0000 +++ b/bin/quine2 Fri Mar 01 02:17:53 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"; then echo "$q" | sed "s,^/bin/sh,`,"; else echo \`"$q"; 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