当前位置:网站首页>shell脚本文件遍历 str转数组 字符串拼接
shell脚本文件遍历 str转数组 字符串拼接
2022-07-05 11:00:00 【诸葛钢铁云】
#!/bin/bash
#file=$(cat /Users/jian.wang13/code/test/0701.txt)
#houzhui=$(awk -F '/' '{print $3}' /Users/jian.wang13/code/test/0701.txt)
houzhui=$(awk -F '/' '{print $3}' /root/snap/0701.txt)
#echo $houzhui,字符串拼接
qianzhui="XXXXX.com/"
for i in $houzhui
do
# echo $i
for j in $qianzhui
do
aws_jingxiang=$j$i
cn_jingxiang="XXXXX/"$i
echo $cn_jingxiang","$aws_jingxiang >> "/root/snap/jingxiang.txt"
if [ $? -eq 0 ];then
break
fi
done
done
#file2='/Users/jian.wang13/code/test/jingxiang.txt'
# 取出文件每行的拿一列
#file3=$(cat /Users/jian.wang13/code/test/jingxiang.txt)
for line in `cat /root/snap/jingxiang.txt`
do
# echo $line
units=(`echo $line | tr ',' ' '`)
# echo ${units[0]} ${units[1]}
docker pull ${units[0]} && docker tag ${units[0]} ${units[1]} && docker push ${units[1]}
done
echo '' > "/root/snap/jingxiang.txt"
@@@@@@@@@@@@@@@@@@@@@
后台执行 &>/dev/null &
边栏推荐
- LSTM applied to MNIST dataset classification (compared with CNN)
- Node の MongoDB Driver
- 购买小间距LED显示屏的三个建议
- 2021 Shandong provincial competition question bank topic capture
- uniapp
- 如何将 DevSecOps 引入企业?
- 基础篇——REST风格开发
- 四部门:从即日起至10月底开展燃气安全“百日行动”
- Review the whole process of the 5th Polkadot Hackathon entrepreneurship competition, and uncover the secrets of the winning projects!
- Do you really understand the things about "prototype"? [part I]
猜你喜欢
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
【广告系统】Parameter Server分布式训练
购买小间距LED显示屏的三个建议
基于昇腾AI丨以萨技术推出视频图像全目标结构化解决方案,达到业界领先水平
9、 Disk management
2022 chemical automation control instrument examination questions and online simulation examination
Detailed explanation of DDR4 hardware schematic design
Characteristics and electrical parameters of DDR4
关于vray5.2怎么关闭日志窗口
32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
随机推荐
Modulenotfounderror: no module named 'scratch' ultimate solution
Taro advanced
In the last process before the use of the risk control model, 80% of children's shoes are trampled here
Detailed explanation of DDR4 hardware schematic design
msfconsole命令大全,以及使用说明
Paradigm in database: first paradigm, second paradigm, third paradigm
vite//
2022 Pengcheng cup Web
Data type
修复动漫1K变8K
PWA (Progressive Web App)
Share Net lightweight ORM
Pull up loading principle
[advertising system] parameter server distributed training
Go语言-1-开发环境配置
When using gbase 8C database, an error is reported: 80000502, cluster:%s is busy. What's going on?
基于昇腾AI丨爱笔智能推出银行网点数字化解决方案,实现从总部到网点的信息数字化全覆盖
Lombok 同时使⽤@Data和@Builder 的坑,你中招没?
Node の MongoDB Driver
不要再说微服务可以解决一切问题了!