当前位置:网站首页>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
边栏推荐
- 用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
- Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
- Structure actual training camp | after class homework | module 6
- You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
- 英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
- namespace基础介绍
- [digital analog] source code of MATLAB allcycles() function (not available before 2021a)
- Win11远程桌面连接怎么打开?Win11远程桌面连接的五种方法
- 论文上岸攻略 | 如何快速入门学术论文写作
- Tiktok may launch an independent grass planting community platform: will it become the second little red book
猜你喜欢
Camera calibration (I): robot hand eye calibration
Easycvr cannot be played using webrtc. How to solve it?
[team learning] [34 issues] scratch (Level 2)
Break the memory wall with CPU scheme? Learn from PayPal to expand the capacity of aoteng, and the volume of missed fraud transactions can be reduced to 1/30
深入解析Kubebuilder
窗口可不是什么便宜的东西
R语言主成分pca、因子分析、聚类对地区经济研究分析重庆市经济指标
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
acwing 843. n-皇后问题
随机推荐
浙江大学周亚金:“又破又立”的顶尖安全学者,好奇心驱动的行动派
How do test / development programmers get promoted? From nothing, from thin to thick
架构实战训练营|课后作业|模块 6
树与图的深度优先遍历模版原理
微信能开小号了,拼多多“砍一刀”被判侵权,字节VR设备出货量全球第二,今日更多大新闻在此
Web3 社区中使用的术语
【數模】Matlab allcycles()函數的源代碼(2021a之前版本沒有)
acwing 843. n-皇后问题
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
軟件測試之網站測試如何進行?測試小攻略走起!
一度辍学的数学差生,获得今年菲尔兹奖
leetcode 53. Maximum Subarray 最大子数组和(中等)
Intel David tuhy: the reason for the success of Intel aoten Technology
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报
jvm是什么?jvm调优有哪些目的?
广告归因:买量如何做价值衡量?
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
深入解析Kubebuilder
图灵诞辰110周年,智能机器预言成真了吗?
Code source de la fonction [analogique numérique] MATLAB allcycles () (non disponible avant 2021a)