The read command reads information from a line of the keyboard or file and assigns it to a variable. Readvar1helloworld puts helloworld into the variable var1, which can be viewed through echo $ var1 output. When the variable after reading is a value, it is assigned all the content before the carriage return. Www.2ct...
The read command reads information from a line of the keyboard or file and assigns it to a variable. Read var1hello world puts hello world into the variable var1, which can be viewed through echo $ var1 output. When the variable after reading is a value, it is assigned all the content before the carriage return. Www.2cto.com read var1 var2hello world put hello into var1, world put into var2. When there are multiple variables after the read operation, values are assigned separately by space. When there are more than variables, all the following values are assigned to the last variable. for example, read var1 var2how are you: put how into var1, are you into var2. Author: CrazyNemo
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