哪吒机器人提醒:

提醒:Stand Alone Complex
【标题】Bash shell的读取、声名和数组
【摘要】变量的有效范围1 启动一个shell时,操作系统分配一块内存给shell使用,这个区域的变量可以让子程序访问;2 利用export功能,可以让变量内容写到上述内存中(环境变量);3 当加载另一个shell时,子shell可以将父shell的环境变量所在的内存导入自己的环境变量区块中。变量的键盘读取#read#读取 putin变量[klot@localhost ~]$ read putinthis is put in.[klot@localhost ~]$ echo $putinthis is put in.[klot@localhost ~]$# 10秒内输入自己的名字,制作成name变量[klot@localhost ~]$ read -p "enter your name:" -t 10 nameenter your name:klot[klot@localhost ~]$ echo $nameklot# declare / typeset# 这两个命令用于生命变量的属性# -a 定义为数组(array)# -i 定义为整数数字(integer)# -x 定义为环境变量,与expo... (04-13 19:15)