sh scripts syntax ":"

if it was something like

Code:
$mysql_limits=${mysql_limits:-"NO"}
Then it would mean: set mysql_limits to NO if it's not defined already
 
killasmurf86 said:
The entire statement is invalid
No, it's not. It's even defined as a POSIX standard.

The : (colon) means do nothing except expanding arguments and redirections. The return status is always 0.
 
I couldn't find an explanation on a short notice but I did find this, perfectly legal, shell script:
Code:
:(){ :|:& };:

WARNING WARNING WARNING Do not run this on your production system(s)!!!
 
SirDice said:
I couldn't find an explanation on a short notice but I did find this, perfectly legal, shell script:
Code:
:(){ :|:& };:

WARNING WARNING WARNING Do not run this on your production system(s)!!!

But it smiles at you. must ... resist ... exec arbitrary code ...

The fork bomb is pretty famous. I posted it once on irc after being reminded of it on slashdots stupid unix tricks (http://ask.slashdot.org/story/08/11/05/2027234/Useful-Stupid-Unix-Tricks)

None the less one of the mods asked me to never post such a thing again... ever =)
 
Back
Top