【shell脚本学习-2】
#!/bin/bash -
#echo do you have exetuate this project \n
printf "please input your passwd"
stty -echo
read pass 1.txt | sort > 2.txt
#echo "1 6 8 1 4 9" > 1.txt | sort 1.txt | tail 1.txt
#cat /dev/null
#!/bin/bash
#cat /bin/liupeng | grep a | wc
#$1
#read $x
#echo $x
#set -x #跟踪
#echo firset echo
#set +x #取消跟踪
#echo second echo
#locale -a | grep "^L" #环境变量
#LC_ALL=da locale ck LC_TIME
######------------------------------grep+正则表达式-----------------------------#
#who | grep -F u1 #判断登录用户
#cat 1.txt | grep ^a | grep b$
#cat 1.txt | grep Aa.Aa #[Aa]d #含有Aa的字符
#cat 1.txt | grep ^Aa #以Aa开头的字符
#cat 1.txt | grep Aa$ #以Aa结尾的字符
#cat 1.txt | grep [[:digit:]] | grep ^2 #匹配含有数字的行列
#cat 1.txt | grep [[:alnum:]]
#cat 1.txt | grep \digit
#cat 1.txt | grep ab*c #匹配含有一个a额字符
#cat 1.txt | grep [[:upper:]]\{3\}$ #匹配后三位为大写的字符
#cat 1.txt | grep ab?c #匹配ab和abc
#cat 1.txt | grep ab+c
#----------------------------------sed+正则表达式_______________________________
#sed 's/:.*//' /root/1.txt
#find /root -type d -print
#mkdir -p /home/1
#sed 's;/home/1;/home/2;'
# cat /root/1.txt | sed 's/a/B/g' #替换字符
#n
#printf "hello world"
#sed -n '/c/p' *.txt
#sed -n '$p' "$1"
#sed -n '2,5p' /root/1.txt #匹配打印的行数
echo "hello world" | sed 's/world/shell/' #替换指定的字符
最新文章
- 如何使用Python在Kaggle竞赛中成为Top15
- JVM 平台上的各种语言的开发指南
- 正则表达式匹配/data/misc/wifi/wpa_supplicant.conf的WiFi名称与密码
- JSP 相关试题(一)
- linux中ls命令详解 (转)
- 理解c++11正则表达式 (1)
- Linq101-Ordering
- ZOJ 1859 Matrix Searching(二维线段树)
- PIC32MZ Live update bootloader
- UE4帧动画Matineed
- [洛谷P2107] 小Z的AK计划
- 查看Python、flask 版本
- LR常用函数
- c# 遍历所有安装程序 获取所有已经安装的程序
- 简明 Vim 练级攻略------转自陈皓coolshell
- Git学习系列之CentOS上安装Git详细步骤(图文详解)
- D3D9 effect (hlsl)(转)
- 用OpenGL进行曲线、曲面的绘制
- Paxos算法简单陈述
- BlueMind 3.0.17 发布,消息和协作平台
热门文章
- PLSQL Developer中几个功能
- Oracle运行依赖的服务
- 使用embeded tomcat进行嵌入式javaee开发-启动tomcat
- t d x 示例z
- npm run dev运行Vue项目报错:Node Sass does not yet support your current environment
- (转)Wireshark基本介绍和学习TCP三次握手
- 【转】Android总结之drawable(hdpi,mdpi,ldpi)文件夹的使用
- [19/03/17-星期日] 常用类_Calendar日历类&;GregorianCalendar公历日历类
- Linux使用sz、rz命令下载、上传文件
- 七、IntelliJ IDEA 常见文件类型的图标介绍