导航

2021年5月12日 #

文件操作-读写

摘要: 往文件格式化写入 //打印到文件 fprintf(fp, "%s\n", p); 阅读全文

posted @ 2021-05-12 14:10 toughcactus 阅读(39) 评论(0) 推荐(0) 编辑

sed学习 2

摘要: 场景:配置文件一项配置一行,现在通过脚本,使得指定配置项的内容做修改 我觉得应该是清除当前的指定配置项,使用模式匹配 sed '/config_name/d' data.txt 在最后一行的下一行写入包含配置项的文件 sed '$r configAdd' data.txt 在最后一行的下一行添加数据 阅读全文

posted @ 2021-05-12 10:26 toughcactus 阅读(48) 评论(0) 推荐(0) 编辑