当前位置:网站首页>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 
边栏推荐
- After one year, the paper was finally accepted by the international summit
- Food safety | is sugar free really sugar free? These truths need to be known
- pillow的原因ImportError: cannot import name ‘PILLOW_VERSION‘ from ‘PIL‘,如何安装pillow<7.0.0
- System parameter constant table of system architecture:
- oracle rac 19c pdb实例当掉
- [SCM]源码管理 - perforce 分支的锁定
- Snowflake vs. databricks who is better? The latest war report in 2022
- NPM common commands
- Anchor free detector: centernet
- Overview of PCL modules (1.6)
猜你喜欢

Brush the title "sword finger offer" day03

flash闪存使用和STM32CUBEMX安装教程【第三天】

After one year, the paper was finally accepted by the international summit

Summary of binary tree exercises

3D face reconstruction and dense alignment with position map progression network

Food safety | the more you eat junk food, the more you want to eat it? Please keep this common food calorimeter

S交换机堆叠方案配置指南

语音直播系统——开发推送通知需要遵守的原则

视觉SLAM十四讲笔记(一):第一讲+第二讲

Easy to understand! Graphic go synergy principle and Practice
随机推荐
Gbase 8A MPP cluster capacity expansion practice
Understand chisel language. 26. Chisel advanced input signal processing (II) -- majority voter filtering, function abstraction and asynchronous reset
Understand chisel language. 25. Advanced input signal processing of chisel (I) -- asynchronous input and de jitter
Brush the title "sword finger offer" day04
c'mon! Please don't ask me about ribbon's architecture principle during the interview
QT learning (II) -- a brief introduction to QT Creator
吃透Chisel语言.24.Chisel时序电路(四)——Chisel内存(Memory)详解
Write yourself a year-end summary. Happy New Year!
3D face reconstruction and dense alignment with position map progression network
去 OPPO 面试,被问麻了
刷题《剑指Offer》day04
I grabbed a ticket and thought I found the system bug of 12306
Nacos configuration center dynamically refreshes the data source
NFT系统开发-教程
Snowflake vs. databricks who is better? The latest war report in 2022
[cloud native] how can I compete with this database?
File upload of native input tag
Looking for a job for 4 months, interviewing 15 companies and getting 3 offers
Leetcode.814. binary tree pruning____ DFS
How to use tdengine sink connector?