当前位置:网站首页>Shell read read console input, use of read
Shell read read console input, use of read
2022-07-27 10:04:00 【Redamancy06】
1.read Read console input
read yes Shell Built in commands , It is used to read data from standard input and assign values to variables . If there is no redirection , The default is to read the data entered by the user from the keyboard ; If redirected , Then you can read data from the file .
1.1 Basic grammar
read (options) (variables)
options Said options , As shown in the following table ;
variables Represents the variable used to store data , There can be one , There can be more than one .
options and variables It's all optional , If the variable name is not provided , Then the read data will be stored in the environment variable REPLY in .
①options:
- -p: Specify the prompt when reading the value ;
- -t: Specifies the time to wait while reading the value ( second ) If -t Not adding means waiting
②variables
- Variable : Specifies the variable name of the read value
1.2read Use



If the set time is exceeded , Then skip directly 
边栏推荐
- 历时一年,论文终于被国际顶会接收了
- Shell函数、系统函数、basename [string / pathname] [suffix] 可以理解为取路径里的文件名称 、dirname 文件绝对路径、自定义函数
- Intermediate and advanced test questions ": what is the implementation principle of mvcc?
- When I went to oppo for an interview, I got numb
- S switch stacking scheme configuration guide
- Expose a technology boss from a poor family
- Brush the title "sword finger offer" day03
- Concurrent Park and unpark description
- Easy to understand! Graphic go synergy principle and Practice
- GBase 8a MPP集群扩容实战
猜你喜欢

It's great to write code for 32 inch curved screen display! Send another one!
[email protected]、$?、env看所有的全局变量值、set看所有变量"/>Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量

Case of burr (bulge) notch (depression) detection of circular workpiece
![[scm] source code management - lock of perforce branch](/img/c6/daead474a64a9a3c86dd140c097be0.jpg)
[scm] source code management - lock of perforce branch

Review of in vivo detection

去 OPPO 面试,被问麻了

Leetcode.814. binary tree pruning____ DFS

Overview of PCL modules (1.6)

GBase 8a MPP集群扩容实战

如何在树莓派上安装cpolar内网穿透
随机推荐
Shell函数、系统函数、basename [string / pathname] [suffix] 可以理解为取路径里的文件名称 、dirname 文件绝对路径、自定义函数
[cloud native • Devops] master the container management tool rancher
What happens if the MySQL disk is full? I really met you!
刷题《剑指Offer》day04
Live countdown 3 days sofachannel 29 P2P based file and image acceleration system Dragonfly
数据分析如何解决商业问题?这里有份超详细攻略
Talk about 10 scenarios of index failure. It's too stupid
S交换机堆叠方案配置指南
Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量
Food safety | are you still eating fermented rice noodles? Be careful these foods are poisonous!
Is Damon partgroupdef a custom object?
Understand chisel language. 27. Chisel advanced finite state machine (I) -- basic finite state machine (Moore machine)
How to restore the original version after installing Hal Library
Stylegan paper notes + modify code to try 3D point cloud generation
I haven't delivered books for a long time, and I feel uncomfortable all over
华为交换机双上行组网Smart-link配置指南
Review summary of engineering surveying examination
Anchor free detector: centernet
GBase 8a MPP集群扩容实战
7/26 思维+dp+后缀数组的学习