Hi Sharad!
Thanks! I think its a way to check that a variable has some sensible value:
MYTEMP_VAR='' # Evaluates to null somehow.
VAR=$MYTEMP_VAR
: {VAR:="Hi"}
I the above example its sure that VAR will have some value! If there is any
other use case then pls tell me.
On Thu, Aug 9, 2012 at 11:18 PM, Sharad Birmiwal
<[email protected]>wrote:
> $ A=test
> $ echo $A
> test
> $ : ${A:=testing}
> $ echo $A
> test
>
> But...
>
> $ : ${B:=hello}
> $ echo $B
> hello
>
>
> So if A already has a value, the ": ${}" notation does not overwrite the
> value. If A does not have a value (as demonstrated by B), then the value is
> written.
>
>
>
> --
> Mailing list guidelines and other related articles:
> http://lug-iitd.org/Footer
>
--
-*- *Vivek Poddar* -*-
*Technical consultant (OpenERP)*
*Blog:http://vivekimsit.blogspot.in/
*
--
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer