1. Read reading variables from the keyboard
2. Declare/typeset declaring variable types
A. The-i option of the DECLARE command specifies that the variable is an integer type (the default is a string)
B. The-X option of the DECLARE command specifies that the variable is an environment variable (the effect is the same as export)
C. The-R option of the declare command specifies that the variable is a read-only variable
D. +x option for DECLARE command environment variable is a custom variable
3. Array variables
Assignment Method One
Two ways to assign a value
Value Assignment mode three
All elements of an array, subscripts, element lengths, etc.
Cyclic processing
while.sh
#!/bin/Bashvar=([2]=AAA [3]=BBB [4]=CCCCCCCC [1]=... [5]=EFG) forIteminch${var[*]} Do Echo${item} DoneEcho '************' forIteminch${!var[*]} Do Echo${item} Done
The results of the operation are as follows:
Shell simple Use (v) variable two