Mercurial > repo
annotate bin/quine2 @ 2323:63c3c407dbae
<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"; then echo "$q" | sed "s,^/bin/sh,`,"; else echo \\`"$q"; fi\') > bin/quine2
author | HackBot |
---|---|
date | Fri, 01 Mar 2013 02:15:53 +0000 |
parents | db759ee5bcf5 |
children | 90fbdeee6dc0 |
rev | line source |
---|---|
2312
d1fe49123f20
<Jafet> (echo \'#!/bin/sh\'; echo "cat /proc/self/cmdline") > bin/quine2 && bin/quine2
HackBot
parents:
diff
changeset
|
1 #!/bin/sh |
2321
da361e77bd10
<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 $$); 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
HackBot
parents:
2320
diff
changeset
|
2 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 } |
2323
63c3c407dbae
<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"; then echo "$q" | sed "s,^/bin/sh,`,"; else echo \\`"$q"; fi\') > bin/quine2
HackBot
parents:
2322
diff
changeset
|
3 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 |