fun scripts


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? fun scripts
# 1  
Old 04-15-2009
fun scripts

Lets get a list of everyones funny scripts
# 2  
Old 04-16-2009
sure, i'll bite. here's my version of an Obfuscated Ksh script:
Works on Solaris

Code:
_="$(($$\/$$))";$(`[[ "${#@}" \
!= "${_[*]:-)}" ]];`;)&&\exit \
"$((${?%%,}+${_[@]:=%}))"||$(`\
"${_[@]:+:}">|"${@}".~`:)&&$(`\
\sed \-${!:-e} '/^\(\<.*\>\)$/\
,/^\(\<.*\>\)$/{'"${_[*]:?~}"'\
,$s~^\(\<.**\>\)$~|&|~;}' \-e \
'/[:-)]/,/[%-!]/{$,$y?^?#?;}'<\
+("${@:-)}")>>".//${1##/*/}.~"\
;`;)&&$(>&-;:`${-:+};<&-`;$!);\

It has at least some error checking and returns the correct status
if something goes wrong.

Oh. And notice the variety of smiley faces in there.
# 3  
Old 04-16-2009
This is an old one.

At a job interview this was a script I had to explain.

Code:
:(){ :|:& };:

# 4  
Old 04-17-2009
Quote:
Originally Posted by Ikon
This is an old one.

At a job interview this was a script I had to explain.

Code:
:(){ :|:& };:

During a job interview?! imho -- not a very constructive question...

This thing doesn't parse on my system. But what I'd expect is
nothing, since usually the null command comments out the rest
of the line effectively.

Tried it. It doesn't parse on my system in ksh, csh, sh or bash.

Here's one to try on a terminal that supports colors:

Code:
perl -e 'for(0..2){&x($_=q^44,37:07* %41,31:20#%-%44,37:06 *%  %47,37:20 %-^)};
&x($_=q^44,37:07* %41,31:20#%-^);for(0..2){&x($_=q^%47,37:34 %-%41,31:34#%-^)};
sub x{for(split(/%/)){s/(\d\d),(\d\d):/\033[$1m\033[$2m:/;
s/:(\d\d)(\D*)/$2x$1/e;s/-/\033[0m\n/g;print;}}'

# 5  
Old 04-17-2009
Quote:
Originally Posted by Ikon
This is an old one.

At a job interview this was a script I had to explain.

Code:
:(){ :|:& };:

Oh. Just reading it, I'd say this:

Looks like a function declaration with an invalid name, the colon NOP command.

Then it pipes the output of the NOP command to another NOP command
and sticks it in the background.

The {} delimit the function declaration.

The ; is the command separator.

And the final : is just a NOP again.
# 6  
Old 04-17-2009
oh. it does parse if you do this:

Code:
_(){ :|:& };:

# 7  
Old 04-17-2009
Quote:
Originally Posted by Ikon
This is an old one.

At a job interview this was a script I had to explain.

Code:
:(){ :|:& };:

That little guy looks like he'll provide more forks than I have in my kitchen.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. War Stories

Following Cables for Fun!

Hi Folks, I came accross this picture taken a number of years ago now, I just thought I'd share it with you guys. We were in the process of removing equipment from the Data Centre and had followed the cable through to this area, where one of the old patch areas had been. When we lifted the... (2 Replies)
Discussion started by: gull04
2 Replies

2. What is on Your Mind?

Fun things to put in comments in scripts?

Approaching the end of my portion of some STIG/DOD compliance automation and I was challenged by a co-worker to include a story in my code. There are blocks of code that need to be kept the way they are for GIT/Gerrit and then compliance, but otherwise I changed out all the comments into a... (2 Replies)
Discussion started by: Vryali
2 Replies

3. Shell Programming and Scripting

More fun with awk

#!/usr/bin/ksh ls -l $@ | awk ' /^-/ { l = 5*log($5) h = sprintf("%7d %-72s",$5,$8) print "\x1B ls command with histogram of file sizes. The histogram scale is logaritmic, to avoid very short bars for smaller files or very long bars for bigger files. Screenshot: (4 Replies)
Discussion started by: colemar
4 Replies

4. Shell Programming and Scripting

Fun with awk

uggc://ra.jvxvcrqvn.bet/jvxv/EBG13 #!/usr/bin/awk -f BEGIN { for (n=0;n<26;n++) { x=sprintf("%c",n+65); y=sprintf("%c",(n+13)%26+65) r=y; r=tolower(y) } } { b = "" for (n=1; x=substr($0,n,1); n++) b = b ((y=r)?y:x) print b } ... (0 Replies)
Discussion started by: colemar
0 Replies

5. UNIX for Advanced & Expert Users

like to have fun in terminal

Hai Friends I have installed FreeBSD in my system... I have installed it to work in text mode don't have the GUI. The default text color is Black background with White Foreground. I want it to be with Black background with Green Foreground. How could i do that. Thanks in advance Collins (4 Replies)
Discussion started by: collins
4 Replies

6. UNIX for Dummies Questions & Answers

fun with tar

ok, i've figured out my problem with distributed, in Solaris GUI if you click on a tar file it will untar it for you, using paramiters I don't know. now, I've got a tar file in / called dnetc-solaris26-x86.tar i want to install it to the "/Veitch" directory how exactly do I use the tar... (17 Replies)
Discussion started by: veitcha
17 Replies

7. News, Links, Events and Announcements

Fun with FreeBSD

Fun With Automounting on FreeBSD Link: Nice tips for FreeBSD Unix. http://ezine.daemonnews.org/200202/automounting.html (2 Replies)
Discussion started by: killerserv
2 Replies
Login or Register to Ask a Question