From: Chris F.A. Johnson on
On 2010-03-28, Jean-Rene David wrote:
....
> I had forgotten about the $'foo\nbar\n' syntax. What is it
> called again? I didn't see it in the 'Parameter Expansion'
> section of the Posix standard. In fact I found:
>
> 2.6 Word Expansions
> [...]
> The '$' character is used to introduce parameter expansion,
> command substitution, or arithmetic evaluation. If an
> unquoted '$' is followed by a character that is either not
> numeric, the name of one of the special parameters (see
> Special Parameters), a valid first character of a variable
> name, a left curly brace ( '{' ) or a left parenthesis, the
> result is unspecified.
>
> Which left me perplexed. Is that notation not standard?

No, it is not standard (bash and zsh only, AFAIK).


--
Chris F.A. Johnson, author <http://shell.cfajohnson.com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
===== My code in this post, if any, assumes the POSIX locale =====
===== and is released under the GNU General Public Licence =====