annotate bin/quine2 @ 2327:e611d53bc5e8

<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 /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:22:51 +0000
parents 3f8c4de90983
children d85907fd544f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 }
2327
e611d53bc5e8 <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 /hackenv/bin/"; then echo "$q" | sed "s,^/bin/sh /hackenv/bin/,\\`,"; else echo \\`"$q"; fi\') > bin/quine2
HackBot
parents: 2326
diff changeset
3 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