当前位置:网站首页>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}' `
边栏推荐
猜你喜欢
R language [data management]
Five layer network protocol
MySQL deep paging optimization with tens of millions of data, and online failure is rejected!
2022-07-03-cka- latest feedback from fans
Influence of oscilloscope probe on measurement bandwidth
校招期间 准备面试算法岗位 该怎么做?
让开发效率飞速提升的跨端方案
【案例】定位的运用-淘宝轮播图
Deployment of Jenkins under win7
显示屏DIN 4102-1 Class B1防火测试要求
随机推荐
shell编程100例
MySQL deep paging optimization with tens of millions of data, and online failure is rejected!
SYSTEMd resolved enable debug log
Clickhouse copy paste multi line SQL statement error
Golang(1)|从环境准备到快速上手
当用户登录,经常会有实时的下拉框,例如,输入邮箱,将会@qq.com,@163.com,@sohu.com
[case] Application of positioning - Taobao rotation map
基於flask寫一個接口
Introduction to TS, constructor and its this, inheritance, abstract class and interface
使用WebAssembly在浏览器端操作Excel
木板ISO 5660-1 热量释放速率摸底测试
判断横竖屏的最佳实现
基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
股票开户选择哪家证券公司比较好哪家平台更安全
Matplotlib drawing retouching (how to form high-quality drawings, such as how to set fonts, etc.)
LeetCode: Distinct Subsequences [115]
Write an interface based on flask
Pytorch实战——MNIST数据集手写数字识别
Binary search
When a user logs in, there is often a real-time drop-down box. For example, entering an email will @qq com,@163. com,@sohu. com