当前位置:网站首页>Read of shell internal value command
Read of shell internal value command
2022-07-07 04:44:00 【TimeFriends】
Shell Internal value command read
read Read console input
The goal is :
understand read Role of command
Use read Assign values to multiple variables
Use read Read a character
Use read Limit time input
Introduce :
read yes shell Built in commands , Used to read data from standard input and assign it to variable , If there is no redirection , The default is to read the data entered by the user from the terminal console , If redirected , Then you can read data from the file .
grammar :read [options] [var1 var2]
options Said options , As shown below ,var Represents the variable used to store data , It could be a , It can be multiple
-n num Read num Characters , Instead of a whole line of characters
-p prompt Display prompt message , The tip is prompt
-s silent mode , The input characters will no longer be displayed on the screen
-t seconds Set timeout , The unit is in seconds , If the user does not complete the input within the specified time , that read Will return a non 0 The exit status of , Indicates a read failure .
Instance of a : Multiple variable assignments


Example 2 : Read a character


Examples of three : Limit time input


Summary
read What is the order
Used to read standard input ( Terminal console user input data )
read Assign values to multiple variables
read var1 var2
read Read a character
read -n 1 var1
read Limit time input
read -t Number of seconds var1
边栏推荐
- How to open win11 remote desktop connection? Five methods of win11 Remote Desktop Connection
- Jetson nano configures pytorch deep learning environment / / to be improved
- How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?
- MySQL split method usage
- 窗口可不是什么便宜的东西
- Optimization of channel status offline of other server devices caused by easycvr cluster restart
- True global ventures' newly established $146million follow-up fund was closed, of which the general partner subscribed $62million to invest in Web3 winners in the later stage
- 九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
- 这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩
- Organize five stages of actual attack and defense drill
猜你喜欢
![[team learning] [34 issues] scratch (Level 2)](/img/29/8383d753eedcffd874bc3f0194152a.jpg)
[team learning] [34 issues] scratch (Level 2)

Optimization of channel status offline of other server devices caused by easycvr cluster restart

用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30

NFT meta universe chain diversified ecosystem development case

Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"

【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ

AI 落地新题型 RPA + AI =?

Win11玩绝地求生(PUBG)崩溃怎么办?Win11玩绝地求生崩溃解决方法

On the 110th anniversary of Turing's birth, has the prediction of intelligent machine come true?
![[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp](/img/eb/9aed3bbbd5b6ec044ec5542297f3c6.jpg)
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
随机推荐
MySQL null value processing and value replacement
Both primary and secondary equipment numbers are 0
赠票速抢|行业大咖纵论软件的质量与效能 QECon大会来啦
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
Meaning of 'n:m' and '1:n' in database design
Why does WordPress open so slowly?
How to conduct website testing of software testing? Test strategy let's go!
Jetson nano配置pytorch深度学习环境//待完善
EasyCVR集群重启导致其他服务器设备通道状态离线情况的优化
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
AI landing new question type RPA + AI =?
【实践出真理】import和require的引入方式真的和网上说的一样吗
You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
The root file system of buildreoot prompts "depmod:applt not found"
軟件測試之網站測試如何進行?測試小攻略走起!
C # use Siemens S7 protocol to read and write PLC DB block
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
Practice Guide for interface automation testing (middle): what are the interface testing scenarios
Camera calibration (I): robot hand eye calibration
leetcode 53. Maximum Subarray 最大子数组和(中等)