Content deleted Content added
→Shell scripting, operator or not?: sigil, darn it. |
|||
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
<pre>
FOO=123 # no "
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
[[Special:Contributions/24.85.131.247|24.85.131.247]] ([[User talk:24.85.131.247|talk]]) 05:46, 26 January 2014 (UTC)
|