[TUHS] sh and goto

George Michaelson ggm at algebras.org
Wed Dec 16 14:41:46 AEST 2020


Great solution. Not entirely "side effect free.."

On Wed, Dec 16, 2020 at 2:30 PM Richard Salz <rich.salz at gmail.com> wrote:
>
>
>> trap is a setjmp/longjmp type outcome. You pop up in a call you didn't
>> exactly "plan" for (well you did: you wrote it. But you don't know the
>> entry state which led you there, unlike normal program flow) -well, it
>> is.. because you get there.
>
>
> I once won a Usenix contest for using /bin/sh to test your reflexes.
>
> trap "ls | wc ; exit 0" 0 1 2 3 15
> ls * | wc -l
> echo "Type ^C; see how close you can make your number match"
> rm -rf * | wc -l
> kill -1 $$ # For those without "trap 0"
>


More information about the TUHS mailing list