1. Local variable: External 2. environment variable: export to output. The sub-shell is valid. The variables set by the parent shell are also applicable to the sub-shellexport. The current 1 and local variables are displayed: the local variable is invalid for the sub-shell./bin/bash: Enter the sub-shell env to display the environment variables in the specified environment. The environment variables set by the system can be displayed: however, some of the environment variables here are not fixed. For example, PWD will change with the Directory, which is why it is used. Cd-, You can CommandSwitch between the Directory and the directory where the previous command is located. The operation is as follows: echo $? $0 shell commands $1 to $2 represent the shell's parameters $ ID of the script run $ # number of parameters passed to the script
$ * Display all parameters passed to the script with a single string
$! ID of the backend operation
$ @ Is the same as $ #, but it must be enclosed by quotation marks and each parameter is returned in quotation marks.
$-The current options used by the shell are the scripts containing these special variables: The result output after the script is executed: arithmetic operation $ [] or $ (())
A = 3
B = 2
Echo "$ [$ A + $ B]" or echo "$ ($ A + $ B ))":
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service