The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > The Lounge > What's on Your Mind?
.
google unix.com



What's on Your Mind? Come inside and relax a while. Maybe play a few Video Arcade Games if you have free time.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Profile scripts versus rc scripts.... rookie22 UNIX for Dummies Questions & Answers 1 09-17-2008 09:31 AM
To run scripts rollthecoin AIX 1 04-04-2008 10:16 AM
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 01:45 PM
Regarding Changes in jil scripts ranga27 UNIX for Advanced & Expert Users 0 09-07-2007 03:15 PM
scripts FLXS Shell Programming and Scripting 3 11-11-2002 10:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 04-15-2009
JamieMurry JamieMurry is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 29
fun scripts

Lets get a list of everyones funny scripts
  #2 (permalink)  
Old 04-16-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
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 (permalink)  
Old 04-16-2009
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
This is an old one.

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

Code:
:(){ :|:& };:
  #4 (permalink)  
Old 04-17-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
Quote:
Originally Posted by Ikon View Post
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 (permalink)  
Old 04-17-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
Quote:
Originally Posted by Ikon View Post
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 (permalink)  
Old 04-17-2009
DeepakS's Avatar
DeepakS DeepakS is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 74
Quote:
Originally Posted by Ikon View Post
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.
  #7 (permalink)  
Old 04-17-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
oh. it does parse if you do this:

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0