[olug] sed issues inside of a script
Obi-Wan
obiwan at jedi.com
Tue Nov 13 22:55:46 UTC 2007
> ${var} is the "standard" way to do variable
> references of any kind in bash, deprecating the sh standard of $var and most
> of the modifiers within {} are still expecting a normal scalar value.
${var} has been a standard syntax in sh for a very, very long time. It
certainly predates bash. Omitting the braces is merely a shorthand
that can be used unless a var is followed by a letter, digit, or
underscore that is not to be interpreted as part of its name.
Basically, the braces allow you to do variable substitution when the
variable is immediately followed by more alphanumeric text.
--
Ben "Obi-Wan" Hollingsworth obiwan at jedi.com
The stuff of earth competes for the allegiance I owe only to the
Giver of all good things, so if I stand, let me stand on the
promise that You will pull me through. -- Rich Mullins
More information about the OLUG
mailing list