[GTALUG] Bash Problem

Chris F.A. Johnson chris at cfajohnson.com
Mon Jan 9 20:26:57 EST 2017


On Mon, 9 Jan 2017, Bob Jonkman via talk wrote:

> Chris F.A. Johnson wrote:

>>> newName="${oldname}-bkp-${filedate}.${extension}.old"
>>
>> The braces are not necessary here.
>
> Are braced incorrect here? I've been putting braces around all
> variable names, so that there are fewer syntax exceptions for me to
> remember...

They are not incorrect, just unnecessary.

The only time they are necessary is when the variable name is followed
by a character that is legal in a variable name.

Or when modifying the output of the variable expansion.

-- 
Chris F.A. Johnson, <http://cfajohnson.com>


More information about the talk mailing list