shell输入输出

输出

一、echo命令介绍
1.功能:将内容输出到默认显示设备
2.语法:echo [-ne] [字符串] ;输出的字符串以空格隔开,默认会加上换行符
3.选项
    -n 不要在最后自动换行 
    -e 如果字符串中出现以下字符,则特别加以处理,而不会把它当一般文字输出
        	 一个tab
        
 换行
        a 警告声
        字符串字符串  先删除前边的,再显示后边的  
二、字体颜色
1.格式:"33[背景色;字体色 字符串 33[属性效果"
2.字颜色:30-37
  字背景颜色:40-47
  效果:0m关闭所有属性
       1m设置高亮度
       4m下划线
       5m闪烁
       7m反显
       8m消隐

输入

read命令

默认接受键盘输入,回车代表输入结束

命令选项:
    -p 打印信息
    -t 限定时间
    -s 不回显(也就是不显示输入的内容)
    -n 输入字符个数
When nothing seems to help, I go look at a stonecutter hammering away at his rock, perhaps a hundred times without as much as a crack showing in it. Yet at the hundred and first blow it will split in two, and I know it was not that blow that did it, but all that had gone before. -- Jacob Riis
原文地址:https://www.cnblogs.com/xhwy-1234/p/12108792.html