Talk:Sigil (computer programming): Difference between revisions

Content deleted Content added
Line 22:
This page is confused as to whether shell scripting's '$' is a sigil or an operator. Historical context says "Larry Wall adopted shell scripting's use of sigils for his Perl programming language." but Similar phenomenon says "In Unix shell scripting and in utilities such as Makefiles, the "$" is a unary operator that translates the name of a variable into its contents. While this may seem similar to a sigil, it is properly a unary operator for lexical indirection, similar to the * indirection operator for pointers in C, as noticeable from the fact that the dollar sign is omitted when assigning to a variable."
 
: Yes, the $ operator is not a sygilsigil. It means "what follows is special expansion syntax". Variables do not inherently have sygils. Witness:
<pre>
FOO=123 # no "sygilsigil" in assignment
export FOO # none here either
unset FOO # nor here
Line 31:
VAR=$(ls -l) # $(...) denotes process expansion
</pre>
: The <code>$</code> character is not some superfluous sygilsigil, but a necessary escape which indicates that what follows has special meaning. This allows most of a shell command line to be literal text that is minimally processed by breaking into words.
[[Special:Contributions/24.85.131.247|24.85.131.247]] ([[User talk:24.85.131.247|talk]]) 05:46, 26 January 2014 (UTC)