shell脚本之read工具
#!/bin/bash
# -*- coding: utf-8 -*-
# echo -n "please input your name: "
read name
echo "hello $name,welcome to my linux!"
exit 0 #下面来看看使用-p选项的效果,与上面等效。 read -p "please input your name: " name
echo "hello $name,welcome to my linux!"
#-p,添加提示符。 #读取输入,但不在屏幕显示
read -s -p "password: " password
echo "" #用来换行
echo "your password is $password."
exit 0 #设置定时器,-t选项
read -t 5 -p "name: " name
echo "your name is $name."
exit 0
shell脚本之read工具的更多相关文章
- shell脚本动画小工具
shell脚本动画小工具 看gif图: shell脚本版 脚本内容如下: #!/usr/bin/env bash ## ---------------------------------------- ...
- shell脚本调试之工具——bashdb
bash是Unix/Linux操作系统最常用的shell之一,它非常灵活,和awk.c++配合起来异常强大 以下使用一个测试脚本来说明使用bash调试的方法 test.sh #!/bin/bash e ...
- shell脚本调试
转自:http://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/ 一. 前言 shell编程在unix/linux世界中使用得非常广泛,熟 ...
- shell脚本的调试技巧
请参考文章:http://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/index.html 读后的感觉,还是用shell的选项灵活,方便. ...
- 【转】Linux Shell脚本调试技术
本文转载自:https://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/ Shell脚本调试技术 本文全面系统地介绍了shell脚本调试技 ...
- shell脚本调试技术_转
转自:http://itlab.idcquan.com/linux/SHELL/727128.html 参考:https://linux.cn/article-8045-1.html 本文全面系统地介 ...
- 使用sh-x调试shell脚本_转
参考:http://blog.chinaunix.net/uid-20564848-id-73502.html 1. 通过sh -x 脚本名 #显示脚本执行过程2.脚本里set -x选项,轻松跟踪调 ...
- 【转】shell脚本调试(bash trap support bashdb )
原文网址:http://zhu8337797.blog.163.com/blog/static/170617549201122512712136/ 命 令 选 项 功 能 bash –x 脚本名 回显 ...
- Shell脚本调试技术
http://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/ 一. 前言 shell编程在unix/linux世界中使用得非常广泛,熟练掌握 ...
随机推荐
- POJ 3250 Bad Hair Day(单调栈)
[题目链接] http://poj.org/problem?id=3250 [题目大意] 有n头牛,每头牛都有一定的高度,他能看到在离他最近的比他高的牛前面的所有牛 现在每头牛往右看,问每头牛能看到的 ...
- Klaus Aschenbrenner--windbg
http://www.sqlservercentral.com/blogs/aschenbrenner/?page=1
- ubi层次
转:http://www.360doc.com/content/11/0518/13/496343_117643185.shtml UBI是什么? 它是一种flash管理方式 flash是一系列连续的 ...
- Cesium 事件
1.相机事件(移动开始.移动结束等等) viewer.scene.camera.moveEnd.addEventListener(function(){ }): 2.鼠标事件(单击.移动.右键等) v ...
- redis基本命令,配置参数
https://www.w3cschool.cn/redis/redis-pub-sub.html redis-server --maxclients 100000 客户端命令CLIENT LIST ...
- Python扫描指定文件夹下(包含子文件夹)的文件
扫描指定文件夹下的文件.或者匹配指定后缀和前缀的函数. 假设要扫描指定文件夹下的文件,包含子文件夹,调用scan_files("/export/home/test/") 假设要扫描 ...
- linux下Nagios的安装和配置
Nagios是企业普遍使用的最具影响力的网络信息监视系统之一,它可以动态监视指定的网络状态,并在状态异常时发出警告音或邮件报警通知运维人员.监控的类型和警报定时器是完全可定制的. Nagios的另一强 ...
- javascript快速入门14--DOM基础
DOM(Document Object Model)——文档对象模型 什么是DOM? Document Object Model (DOM)是HTML和XML文档的编程接口.它提供了上述文档的一种结构 ...
- OpenGL ES 3.0之Fragment buffer objects(FBO)详解 (转)
http://www.cnblogs.com/salam/p/4957250.html 片段操作图 这篇文章将介绍从写入帧缓冲和读取帧缓冲的方式. Buffers(缓冲) OpenGL ES支持三种缓 ...
- http://www.oschina.net/code/snippet_12_13918
http://www.oschina.net/code/snippet_12_13918