当前位置:网站首页>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 &
边栏推荐
- DDoS attack principle, the phenomenon of being attacked by DDoS
- MFC pet store information management system
- Characteristics and electrical parameters of DDR4
- 2022 chemical automation control instrument examination questions and online simulation examination
- Some understandings of heterogeneous graphs in DGL and the usage of heterogeneous graph convolution heterographconv
- Do you really understand the things about "prototype"? [part I]
- LSTM applied to MNIST dataset classification (compared with CNN)
- Sqlserver regularly backup database and regularly kill database deadlock solution
- How to introduce devsecops into enterprises?
- About the use of Vray 5.2 (self research notes)
猜你喜欢

Repair animation 1K to 8K

Lombok makes ⽤ @data and @builder's pit at the same time. Are you hit?

数据库三大范式

如何将 DevSecOps 引入企业?

关于 “原型” 的那些事你真的理解了吗?【上篇】
![[Oracle] use DataGrid to connect to Oracle Database](/img/4f/886378667889f730eaed39b97f0a39.png)
[Oracle] use DataGrid to connect to Oracle Database
![[JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output](/img/96/b8585205b3faf503686c5bbdcecc53.png)
[JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output

DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法

DDRx寻址原理

华为设备配置信道切换业务不中断
随机推荐
在C# 中实现上升沿,并模仿PLC环境验证 If 语句使用上升沿和不使用上升沿的不同
数据库三大范式
数据类型 ntext 和 varchar 在not equal to 运算符中不兼容 -九五小庞
FreeRTOS 中 RISC-V-Qemu-virt_GCC 的调度时机
Web Security
DDRx寻址原理
Lazy loading scheme of pictures
Operators
Question bank and answers of special operation certificate examination for main principals of hazardous chemical business units in 2022
A mining of edu certificate station
Data type
Taro advanced
msfconsole命令大全,以及使用说明
Basic part - basic project analysis
Dspic33ep clock initialization program
Scaffold development foundation
DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法
Wechat nucleic acid detection appointment applet system graduation design completion (8) graduation design thesis template
关于 “原型” 的那些事你真的理解了吗?【上篇】
uniapp