当前位置:网站首页>Shell script file traversal STR to array string splicing
Shell script file traversal STR to array string splicing
2022-07-05 11:30:00 【Zhuge iron and steel cloud】
#!/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, String splicing
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'
# Take out one column of each line of the file
#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"
@@@@@@@@@@@@@@@@@@@@@
The background to perform &>/dev/null &
边栏推荐
- Empêcher le navigateur de reculer
- Huawei equipment configures channel switching services without interruption
- The ninth Operation Committee meeting of dragon lizard community was successfully held
- Go language learning notes - analyze the first program
- 居家办公那些事|社区征文
- 项目总结笔记系列 wsTax KT Session2 代码分析
- In the last process before the use of the risk control model, 80% of children's shoes are trampled here
- 紫光展锐全球首个5G R17 IoT NTN卫星物联网上星实测完成
- 高校毕业求职难?“百日千万”网络招聘活动解决你的难题
- COMSOL -- three-dimensional graphics random drawing -- rotation
猜你喜欢

COMSOL -- establishment of 3D graphics

Codeforces Round #804 (Div. 2)

Pytorch training process was interrupted

龙蜥社区第九次运营委员会会议顺利召开

分类TAB商品流多目标排序模型的演进

Basics - rest style development

Harbor image warehouse construction

Codeforces Round #804 (Div. 2)

Evolution of multi-objective sorting model for classified tab commodity flow

COMSOL--建立几何模型---二维图形的建立
随机推荐
Deepfake tutorial
【爬虫】charles unknown错误
-26374 and -26377 errors during coneroller execution
以交互方式安装ESXi 6.0
2048游戏逻辑
SET XACT_ABORT ON
MySQL statistical skills: on duplicate key update usage
解决readObjectStart: expect { or n, but found N, error found in #1 byte of ...||..., bigger context ..
DDR4的特性与电气参数
基础篇——REST风格开发
【Office】Excel中IF函数的8种用法
Ddrx addressing principle
What about SSL certificate errors? Solutions to common SSL certificate errors in browsers
MFC pet store information management system
Detailed explanation of DDR4 hardware schematic design
COMSOL--建立几何模型---二维图形的建立
Detailed explanation of MATLAB cov function
[there may be no default font]warning: imagettfbbox() [function.imagettfbbox]: invalid font filename
NFT 交易市场主要使用 ETH 本位进行交易的局面是如何形成的?
Characteristics and electrical parameters of DDR4