当前位置:网站首页>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}' `
边栏推荐
- MySQL deep paging optimization with tens of millions of data, and online failure is rejected!
- What should I do to prepare for the interview algorithm position during school recruitment?
- 使用WebAssembly在浏览器端操作Excel
- POJ 3414 pots (bfs+ clues)
- bazel是否有学习的必要
- Five layer network protocol
- 模式-“里氏替换原则”
- The transformation based on vertx web sstore redis to realize the distributed session of vertx HTTP application
- Sequence alignment
- Evolution of zhenai microservice underlying framework from open source component encapsulation to self-development
猜你喜欢
EasyExcel的讀寫操作
Talk about my fate with some programming languages
基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
2022-07-03-cka- latest feedback from fans
【案例】元素的显示与隐藏的运用--元素遮罩
Clion configures Visual Studio (MSVC) and JOM multi-core compilation
Chapter 05_ Storage engine
The transformation based on vertx web sstore redis to realize the distributed session of vertx HTTP application
示波器探头对信号源阻抗的影响
[case] Application of positioning - Taobao rotation map
随机推荐
SQL series (basic) - Chapter 2 limiting and sorting data
Talk about my fate with some programming languages
Simple getting started example of Web Service
[case] Application of positioning - Taobao rotation map
Deployment of Jenkins under win7
Golang(1)|从环境准备到快速上手
Evolution of zhenai microservice underlying framework from open source component encapsulation to self-development
基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
PHP deserialization +md5 collision
bazel是否有学习的必要
What should I do to prepare for the interview algorithm position during school recruitment?
LeetCode: Distinct Subsequences [115]
使用WebAssembly在浏览器端操作Excel
int GetMonth( ) const throw( ); What does throw () mean?
123456
《SAS编程和数据挖掘商业案例》学习笔记# 19
Longest swing sequence [greedy practice]
selenium 查找b或p标签的内容
2022-07-03-CKA-粉丝反馈最新情况
EasyExcel的读写操作