[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SAGE] Shell programming conundrum



Normally, I consider myself an expert in shell programming, but this one
really has me stumped . . .

Consider the following excerpt of code:

	cmd1

	. . .

	cmd23

	: ${foo:=${foo}}	# <== THIS ONE!

	cmd24 $foo

	. . .

Yes, it's legal shell code. Yes, it works (for a very broad definition
of "work").

We don't know the value of "foo"; I claim it doesn't matter.

Here's the challenge: Tell me what purpose the line marked "THIS ONE!"
serves. I claim you can delete that line and the script will produce the
same exact results -- but I'd love for someone to prove me wrong.

AdamM

P.S. - No, I didn't write this; I found it in a script that someone else
       wrote that I now have to modify.