LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   shell scripting - using ${variable:=","} (https://www.linuxquestions.org/questions/linux-general-1/shell-scripting-using-%24%7Bvariable-%3D-%7D-287304/)

Steve Riley 02-07-2005 10:37 AM

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

kornerr 02-07-2005 11:06 AM

What is Wicked Cool Shell Scripts???

Steve Riley 02-07-2005 11:11 AM

A book of shell scripts by Dave Taylor. Published by No Starch Press.

Padma 02-07-2005 11:13 AM

${TD:=","} Use the variable "TD" if it is set. If it is not set, assign it the value ",", and then use it.

LasseW 02-07-2005 11:36 AM

For a complete list of conditional assignment statements, do 'man bash' and read the paragraph 'Parameter Expansion'.

Steve Riley 02-07-2005 11:45 AM

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.

Steve Riley 02-07-2005 11:47 AM

OK. There it is. Thanks.

heema 02-08-2005 05:07 AM

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.