annotate bin/quine2 @ 2318:7abc8205c350

<Jafet> (echo \'#!/bin/sh\'; echo \'a() { echo $1; p=$(echo -n $(ps -p $1 -oppid | tail -1)); if egrep " \\| cat\\$" /proc/$p/cmdline; then ps -p $1 -ocmd | tail -1; else a $p; fi }\'; echo \'a $$\') > bin/quine2 && quine2 a b c
author HackBot
date Fri, 01 Mar 2013 02:02:16 +0000
parents 32451419357a
children 234b02097c66
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
2318
7abc8205c350 <Jafet> (echo \'#!/bin/sh\'; echo \'a() { echo $1; p=$(echo -n $(ps -p $1 -oppid | tail -1)); if egrep " \\| cat\\$" /proc/$p/cmdline; then ps -p $1 -ocmd | tail -1; else a $p; fi }\'; echo \'a $$\') > bin/quine2 && quine2 a b c
HackBot
parents: 2317
diff changeset
2 a() { echo $1; p=$(echo -n $(ps -p $1 -oppid | tail -1)); if egrep " \| cat\$" /proc/$p/cmdline; then ps -p $1 -ocmd | tail -1; else a $p; fi }
2316
a3d5eada24e3 <Jafet> (echo \'#!/bin/sh\'; echo \'a() { p=$(ps -p $$ -oppid | tail -1); if egrep " \\| cat\\$" /proc/$p/cmdline; then ps -p $0 -ocmd | tail -1; else a $p; fi }\'; echo \'a $$\') > bin/quine2 && cat bin/quine2
HackBot
parents: 2315
diff changeset
3 a $$