what ia :=


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting what ia :=
# 1  
Old 01-03-2007
what ia :=

hi,
In a script i came accross the following satements
1.if [ $decimal != $1 ]; then
2. result="${DD:="."}$decimal"
3. fi

Here in the 2nd line what is the meaning of : before = (DD:=)?

any help pls.

cheers
RRK
# 2  
Old 01-03-2007
sorry ,the title is " is what is :="

cheers
RRK
# 3  
Old 01-03-2007
This is from the man page of ksh:

Quote:
${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. In all cases, the final value of parameter is substituted. Only variables, not positional parameters or special parameters, can be assigned in this way.
So if DD is unset or null, the value of variable DD will be set to '.'

Last edited by blowtorch; 01-03-2007 at 02:24 AM.. Reason: fix formatting
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question