当前位置:网站首页>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
边栏推荐
- Jetson nano configures pytorch deep learning environment / / to be improved
- 计数排序基础思路
- MySQL forgot how to change the password
- Implementation of JSTL custom function library
- Practice Guide for interface automation testing (middle): what are the interface testing scenarios
- jvm是什么?jvm调优有哪些目的?
- 軟件測試之網站測試如何進行?測試小攻略走起!
- 食堂用户菜品关系系统(C语言课设)
- 九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
- 《原动力 x 云原生正发声 降本增效大讲堂》第三讲——Kubernetes 集群利用率提升实践
猜你喜欢
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
【实践出真理】import和require的引入方式真的和网上说的一样吗
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
Intel David tuhy: the reason for the success of Intel aoten Technology
The easycvr platform is connected to the RTMP protocol, and the interface call prompts how to solve the error of obtaining video recording?
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
Introduction to namespace Basics
mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
Windows are not cheap things
How does vscade use the built-in browser?
随机推荐
leetcode 53. Maximum Subarray 最大子数组和(中等)
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
sscanf,sscanf_ S and its related usage "suggested collection"
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
英特尔David Tuhy:英特尔傲腾技术成功的原因
赠票速抢|行业大咖纵论软件的质量与效能 QECon大会来啦
[team learning] [34 issues] scratch (Level 2)
Gpt-3 is a peer review online when it has been submitted for its own research
Implementation of JSTL custom function library
You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
架构实战训练营|课后作业|模块 6
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
How to conduct website testing of software testing? Test strategy let's go!
ESG全球领导者峰会|英特尔王锐:以科技之力应对全球气候挑战
[on automation experience] the growth path of automated testing
过气光刻机也不能卖给中国!美国无理施压荷兰ASML,国产芯片再遭打压
一图看懂!为什么学校教了你Coding但还是不会的原因...