shell 脚本中 命令
2015-09-09 08:03
489 查看
终端工具
tput和stty是两款终端处理工具
tput cols,lines,longname,cpu 100 100
输入密码时,不能让输入的内容显示出来。用stty
tr 命令
tput和stty是两款终端处理工具
tput cols,lines,longname,cpu 100 100
输入密码时,不能让输入的内容显示出来。用stty
#!/bin/bash #Filename:password.sh function enterpassword(){ echo -e "Enter password" stty -echo read password stty echo echo password read } enterpassword
tr 命令
#!/bin/bash #使用tr进行转换 #tr 可以进行替换,删除,压缩 #tr 只能通过stdin,而无法通过命令行参数来接受输入。他的调用格式如下 #替换 echo "Hello who IS ThIs" | tr 'A-M,n-z' 'a-m,N-Z' #删除 echo "hello 0980world" | tr -d '0-9' #压缩的话可以使用 tr -s 来实现#把 文件中的 换行符 压缩成单个字符 cat file.txt|tr -s '\n' #给内容加上行号 cat -n file.txt
相关文章推荐
- powershell的一个小游戏,看看能写几种方式出来
- shell脚本是否作为单独的一个进程执行?
- shell运算
- Vim,find,bash,Linux文件系统的特殊权限2015.8.30作业
- shell--文件操作1
- linux shell 学习时遇到的一些问题([: 11: y: unexpected operator)
- Linux Shell编程(5):整数运算
- Linux Shell编程(4): 逻辑运算符、逻辑表达式详解
- Linux Shell编程(3):数组
- Linux Shell编程(2): for while
- Linux Shell编程(1): 条件语句
- (总结)统计Apache或Nginx访问日志里的独立IP访问数量的Shell
- shell数组
- 使用shell脚本调用mysql数据库存储过程,并设置定时任务
- WinExec, ShellExecute,CreateProcess 的其他注意事项
- Linux shell脚本的字符串截取
- Linux Shell笔记之函数
- shell编程--遍历目录下的文件
- Linux Shell中的数组及遍历
- linux shell 数组建立及使用技巧