shell scripting - using ${variable:=","}
In Wicked Cool Shell Scripts on page 18 toward the bottom I see:
result="${TD:=","}${remainder}${result}" What does the ${TD:=","} do? The variable TD is assigned elsewhere in the script (on page 19). Thanks, Steve |
What is Wicked Cool Shell Scripts???
|
A book of shell scripts by Dave Taylor. Published by No Starch Press.
|
${TD:=","} Use the variable "TD" if it is set. If it is not set, assign it the value ",", and then use it.
|
For a complete list of conditional assignment statements, do 'man bash' and read the paragraph 'Parameter Expansion'.
|
Thanks. I've run into this and:
${variable#?} and ${variable%pattern} but I haven't found a place where these parsing/assignment operators are listed. |
OK. There it is. Thanks.
|
I just wanted to say thanks for pointing out that book , it seams llike a really good shell scripting book , just what i was looking for :)
|
All times are GMT -5. The time now is 08:10 AM. |