Variable settings:
~/dos # dfs=2
Variable use:
You can read it using EHCO, but you need to precede the variable name with $, or the ${variable}.
~/dos # echo $dfs 2 ~/dos # echo ${dfs}
Variable cancellation:
~/dos # unset DFS ~/dos # echo $dfs
Things to note:
1. Variables and variable contents with an equal sign "=" link, as shown: "Myname=vbird"
2. The equal sign cannot be directly connected to the space character, as shown in error: "myname = Vbird" Ring "Myname=vbird Tsai"
3. Variable names can only be English letters and numbers, but the beginning character cannot be a number, as shown in error: "2myname=vbird"
< Span style= "FONT-SIZE:12PT;" > 4. Variable contents If there is a space character can use the double quotation mark "" "or the single quotation mark" ' "to combine the variable content, but
o Span style= "font-family: ' Courier New '; font-size:10pt; " >o span>
< Span style= "FONT-SIZE:12PT;" > 5. Use the caret character "\" To turn special symbols (such as [Enter], $, \, space, ' etc.) into normal characters; span>
< Span style= "FONT-SIZE:12PT;" > 6. In a sequence of instructions, you also need to provide information by other instructions, using the inverted single quotation mark "' Instruction '" ring "$ (Instruction
< Span style= "FONT-SIZE:12PT;" > For example, to get core version setting: Span style= "FONT-SIZE:12PT;" > "version=$ (uname-r)" and "Echo $version" can have "2.6.18-128.el5"
< Span style= "FONT-SIZE:12PT;" > 7. If the variable is the content of the amplified variable, the contents can be summed with the "$ variable name" or the ${volume}, as follows:
8. If the variable needs to be executed in another subroutine , you need to export the variable to an environment variable:
9. The method for canceling the volume is to use unset: "unset-out name", for example, MyName
Exposing with EHCO to be able to read, just is required in the name of the volume of the first add $, the abstinence is ${hair volume} way 杢 canceled use can
"Shell" variable