首页 > 系统服务 > 详细

shell逐行读取替换

时间:2021-05-01 16:38:45      阅读:31      评论:0      收藏:0      [点我收藏+]

#!/bin/bash

while read line
do
echo $line
txt=`echo $line |awk -F‘ ‘ ‘{print $1}‘`
id=`echo $line|awk -F‘ ‘ ‘{print $3}‘`
echo $txt
echo $id
sed "s/ws22041.com/${txt}/g" 2.txt > 4.txt
sed "s/5429/${id}/g" 4.txt >> 5.txt

# sleep 5
done < 3.txt

shell逐行读取替换

原文:https://www.cnblogs.com/yanzi2020/p/14724061.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!