当前位置:网站首页>Problems encountered in office--
Problems encountered in office--
2022-07-05 21:18:00 【6666666666666er】
1.sed Special characters encountered
sed Pattern separator
up to now , We have only used one Separator , That's it The backslash (/).
Suppose we need to use sed Enter... In the source /bin/sed Replace with /home/yufei/bin/sed
because / Is the pattern separator , We have to escape it , namely \/.
echo "/bin/sed" | sed 's/\/bin\/sed/\/home\/yufei\/bin\/sed/'
A vertical bar |
A vertical bar (|) Should be The backslash (/) The most used delimiter outside .
Vertical lines can significantly improve sed Readability of pattern statements .
For example, the order above , We use a vertical bar as a separator , Can be rewritten as
echo "/bin/sed" | sed 's|/bin/sed|/home/yufei/bin/sed|'
2. The last line reads
tail -n 1 tt.txt
I will get One Blank line . In my case , I want to get bonjour.
use Awk:
awk '/./{ line=$0} END{print line}' tt.txt
3. Space split string
awk -F【 keyword 】 '{print $n}'
match_name=`echo "$match_Array" | awk -F ":" '{print $1}' `
边栏推荐
- 终端安全能力验证环境搭建和渗透测试记录
- [daily training -- Tencent select 50] 89 Gray code (only after seeing the solution of the problem)
- SQL series (basic) - Chapter 2 limiting and sorting data
- Monorepo management methodology and dependency security
- Golang (1) | from environmental preparation to quick start
- selenium 获取dom内属性值的方法
- Material design component - use bottomsheet to show extended content (II)
- Wood board ISO 5660-1 heat release rate mapping test
- js常用方法封装
- Is Kai Niu 2980 useful? Is it safe to open an account
猜你喜欢

基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)

Teach yourself to train pytorch model to Caffe (2)

张丽俊:穿透不确定性要靠四个“不变”

第05章_存储引擎

Five layer network protocol

Add ICO icon to clion MinGW compiled EXE file

Cross end solution to improve development efficiency rapidly

Clion-MinGW编译后的exe文件添加ico图标

MySQL InnoDB Architecture Principle

Write an interface based on flask
随机推荐
AITM 2-0003 水平燃烧试验
The reason why the ncnn converted model on raspberry pie 4B always crashes when called
树莓派4B上ncnn转换出来的模型调用时总是崩溃(Segment Fault)的原因
【日常训练】729. 我的日程安排表 I
[case] Application of positioning - Taobao rotation map
Get JS of the previous day (timestamp conversion)
js常用方法封装
EN 438-7 laminated sheet products for building covering decoration - CE certification
有些事情让感情无处安放
PHP deserialization +md5 collision
Sequence alignment
【案例】元素的显示与隐藏的运用--元素遮罩
Dictionary tree simple introductory question (actually blue question?)
MYSQL IFNULL使用功能
Aitm 2-0003 horizontal combustion test
Golang (1) | from environmental preparation to quick start
Interviewer: will concurrent programming practice meet? (detailed explanation of thread control operation)
int GetMonth( ) const throw( );后面的throw( )什么意思?
Using webassembly to operate excel on the browser side
【案例】定位的运用-淘宝轮播图