} else {if( ~ /^[[:space:]]+/)str=str "\t" gensub(/^[[:space:]]+/"og:type" content="webpage">} else {if( ~ /^[[:space:]]+/)str=str "\t" gensub(/^[[:space:]]+/" /> } else {if( ~ /^[[:space:]]+/)str=str "\t" gensub(/^[[:space:]]+/"> linux中怎么把文本中前面带空格的一行追加到,前一行,追加的时候他们之间要有空格隔开。_系统运维_内存溢出

阅读 11

linux中怎么把文本中前面带空格的一行追加到,前一行,追加的时候他们之间要有空格隔开。,第1张

试下这个:

#!/bin/bash

awk '{

if(NR==1){

str=$0

} else {

if($0 ~ /^[[:space:]]+/)

str=str "\t" gensub(/^[[:space:]]+/, "", "", $0)

else

str=str "\n" $0

}

}

END{

print str}' /jiankong/diskcheck_tmp感觉你的需求只是简单的把"<<"作为查询条件,那么就直接把这一行信息

挑出

来了。


cat a.txt | grep "<<" >b.txt

你试试看吧

欢迎分享,转载请注明来源:内存溢出

原文地址:
http://outofmemory.cn/yw/8905081.html隔开
试试
(0) 微信扫一扫 打赏 支付宝扫一扫 微信扫一扫
支付宝扫一扫
123网址之家首页 123网址之家首页
linux下限制用户最多只能使用20M磁盘空间,50个文件。
上一篇
2023-04-22
Linux如何安装tar.gz文件?
2023-04-22

发表评论 后才能评论
提交

评论列表(0条)

2022-5-23

商务电话
飞走了
} else {if( ~ ^[[:space:]]+)str=str "t" gensub(^[[:space:]]+", "pubDate": "2023-04-22", "upDate": "2023-04-22" } } else {if( ~ ^[[:space:]]+)str=str "t" gensub(^[[:space:]]+', author : '123网址之家首页', cat_name : '系统运维', time_y_m : '2023年04月', time_d : '22', site_motto : '内存溢出' };
保存{label} {label} {label} {label} {script} {script} {script} {script}