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世界中使用得非常广泛,熟练掌握 ...
随机推荐
- 1.1(Spring学习笔记)Spring基础(BeanFactory、ApplicationContext 、依赖注入)
1.准备工作 下载Spring:http://repo.spring.io/libs-release-local/org/springframework/spring/ 选择需要下载的版本 ...
- (转)[Unity3D]计时器/Timer
http://blog.sina.com.cn/s/blog_5b6cb9500101aejs.html 项目中管理计时器太混乱难看了,用好听点的话来说就是代码不优雅. 想了下就随手简单写了个时间 ...
- binlog监听工具-canal
官网 https://github.com/alibaba/canal/wiki
- 阿里云乌班图16配置-PHP环境(包括mysql及apache安装)
1. 安装apache apt-get update apt-get install apache2 service apache2 restart 通过浏览器访问服务器的IP,如果出现Apac ...
- 消息队列系列(三):.Rabbitmq Trace的使用
一.什么是Trace Trace是Rabbitmq用于记录每一次发送的消息,方便使用Rabbitmq的开发者调试.排错.可通过插件形式 提供可视化界面 二.Trace实现概况 ...
- 利用CMD查看系统硬件信息
利用CMD查看系统硬件信息对于在windows下查看系统信息大家一定不陌生了,我现在说几个最常用的方法,对命令感兴趣的朋友看看,(给菜鸟看的,老手就不要笑话我了,大家都是从那个时候过来的,^_^).一 ...
- storm安装配置
1.修改主机名: vim /etc/sysconfig/network NETWORKING=yes HOSTNAME=MASTER 2.修改IP: 先用ifconfig得到ip信息,将其复制 设置i ...
- 警惕rapidxml的陷阱(二):在Android上默认内存池分配数组过大,容易导致栈溢出
上一篇随笔中提到了,rapidxml在每个xml对象中维护了一个内存池,自己管理变量的生存周期.看起来很好,但我们在实际使用中还是出现了问题. 项目中我们的模块很快写好了,在windows和linux ...
- HTML5 Canvas 绘制库存变化折线 画入库出库柱状图
代码: <!DOCTYPE html> <html lang="utf-8"> <meta http-equiv="Content-Type ...
- C#文本框中默认是不允许使用全选的
C#文本框中默认是不允许使用全选的.可以通过以下事件完成: private void textBox1_KeyDown(object sender, KeyEventArgs e) { i ...