?

Log in

No account? Create an account
Well -- I know you're all dying to hear about my April Fool's day… - CERisE's Testing for L

> Recent Entries
> Archive
> Friends
> Profile

April 2nd, 2007


Previous Entry Share Next Entry
12:00 pm
Well -- I know you're all dying to hear about my April Fool's day prank. I've only had two reports of it -- which is a shame. I was really rather proud of it.

The easiest way to go about this is to explain what the effect was:

boogeyman tmp # mkdir /tmp/a
boogeyman tmp # cd a
boogeyman a # touch b c d


So there's a directory with 3 files in it. If we do an ls of one of them -- we should see it.

boogeyman a # /tmp/april/ls b
boogeyman a # /tmp/april/ls b
b


...What? Let's try that again!

boogeyman a # /tmp/april/ls b
boogeyman a # /tmp/april/ls b
b


Ok -- what the heck is up with ls!?!?!?

boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
boogeyman a # /tmp/april/ls 
b  c  d
boogeyman a #


So in essence, you try to run your command and sometimes it works, sometimes it doesn't. relsqui went for it -- her screen commands stopped working. One user (nova20) said "Geez, do I have to ask the Magic 8-Ball if I can run my command?!??!"

Well -- after a fashion, you do!

#!/bin/sh

let blah=$RANDOM%2
export PATH="$(echo $PATH | /bin/sed 's/[/]tmp[/]april[/][:]//g')"
if [ $blah -eq 0 ]; then
   PROG="$(echo $0 | /bin/sed 's/[^/]*[/]//g')"
   exec $PROG $@
   exit
else
   echo -n
fi


In essence, take a random number. If it's even, run the command properly. If it's odd, do nothing.

This was perpetrated by tucking /tmp/april into $PATH in /etc/profile, making hard links to the script for every executable in $PATH in /tmp/april, and waiting. 8)

(1 comment | Leave a comment)

Comments:


[User Picture]
From:nyankoframe
Date:April 3rd, 2007 01:46 am (UTC)
(Link)
I never even logged in, so I wouldn't know. :P But yeah, that was a pretty awesome prank.

> Go to Top
LiveJournal.com