当前位置:网站首页>shell语句修改txt文件或者sh文件
shell语句修改txt文件或者sh文件
2022-08-05 02:22:00 【fK0pS】
shell语句修改txt文件或者sh文件
基本思路,使用正则表达式,找到目标,替换目标,保存文件
shell sed regular expression
regular expression
方案1:
runScSparkFilename="runScSpark.sh" sed -i "s/$search/$replace/" $filename
方案2:
$ cat /etc/syslog.conf | sed -n '/^[[:alpha:]]/p' authpriv.* /var/log/secure

边栏推荐
- 继承关系下构造方法的访问特点
- 亚马逊云科技携手中科创达为行业客户构建AIoT平台
- [Decryption] Can the NFTs created by OpenSea for free appear in my wallet without being chained?
- How do programmers without objects spend the Chinese Valentine's Day
- 网络安全与元宇宙:找出薄弱环节
- 力扣-二叉树的最大的深度
- Greenplum Database Fault Analysis - Why Does gpstart -a Return Failure After Version Upgrade?
- 多线程(2)
- 蚁剑高级模块开发
- RAID disk array
猜你喜欢
随机推荐
Transfer Learning - Joint Geometrical and Statistical Alignment for Visual Domain Adaptation
LPQ(局部相位量化)学习笔记
[Word] #() error occurs after Word formula is exported to PDF
基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
开篇-开启全新的.NET现代应用开发体验
SuperMap iDesktop.Net之布尔运算求交——修复含拓扑错误复杂模型
力扣-二叉树的最大的深度
如何基于OpenVINO POT工具简单实现对模型的量化压缩
【OpenCV 图像处理2】:OpenCV 基础知识
Unleashing the engine of technological innovation, Intel joins hands with ecological partners to promote the vigorous development of smart retail
Short domain name bypass and xss related knowledge
nodeJs--封装路由
Access Characteristics of Constructor under Inheritance Relationship
std::string::find 返回值的坑
sql语句多字段多个值如何进行排序
Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?
蚁剑高级模块开发
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)
【MySQL series】- Does LIKE query start with % will make the index invalid?









