Sponsored Content
Full Discussion: fun scripts
The Lounge What is on Your Mind? fun scripts Post 302308178 by quirkasaurus on Friday 17th of April 2009 10:02:17 AM
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.
 

7 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

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. 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

6. 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

7. 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
FORTUNE(6)							 BSD Games Manual							FORTUNE(6)

NAME
fortune -- print a random, hopefully interesting, adage SYNOPSIS
fortune [-aefilosw] [-m pattern] [[N%] file/dir/all] DESCRIPTION
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is subdivided into those which are potentially offensive and those which are not. The options are as follows: -a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.) -e Consider all fortune files to be of equal size (see discussion below on multiple files). -f Print out the list of files which would be searched, but don't print a fortune. -l Long dictums only. -m Print out all fortunes which match the regular expression pattern. See regex(3) for a description of patterns. -o Choose only from potentially offensive aphorisms. Please, please, please request a potentially offensive fortune if and only if you believe, deep down in your heart, that you are willing to be offended. (And that if you are, you'll just quit using -o rather than give us grief about it, okay?) ... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes" -s Short apothegms only. -i Ignore case for -m patterns. -w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe- cuted as part of the logout procedure to guarantee that the message can be read before the screen is cleared. The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number N between 0 and 100 inclu- sive, followed by a %. If it is, there will be a N percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes. As an example, given two databases funny and not-funny, with funny twice as big, saying fortune funny not-funny will get you fortunes out of funny two-thirds of the time. The command fortune 90% funny 10% not-funny will pick out 90% of its fortunes from funny (the ``10% not-funny'' is unnecessary, since 10% is all that's left). The -e option says to consider all files equal; thus fortune -e is equivalent to fortune 50% funny 50% not -funny FILES
/usr/share/fortune SEE ALSO
regex(3), regcmp(3), BSD
April 19, 1994 BSD
All times are GMT -4. The time now is 01:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy