当前位置:网站首页>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 &
边栏推荐
- Manage multiple instagram accounts and share anti Association tips
- Summary of thread and thread synchronization under window
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
- Three paradigms of database
- Risc-v-qemu-virt in FreeRTOS_ Scheduling opportunity of GCC
- Ffmpeg calls avformat_ open_ Error -22 returned during input (invalid argument)
- 871. Minimum Number of Refueling Stops
- 2048 game logic
- 【爬虫】wasm遇到的bug
- 爬虫(9) - Scrapy框架(1) | Scrapy 异步网络爬虫框架
猜你喜欢
【Oracle】使用DataGrip连接Oracle数据库
技术管理进阶——什么是管理者之体力、脑力、心力
Ziguang zhanrui's first 5g R17 IOT NTN satellite in the world has been measured on the Internet of things
Basics - rest style development
Codeforces Round #804 (Div. 2)
Harbor镜像仓库搭建
COMSOL -- establishment of 3D graphics
DDR4硬件原理图设计详解
COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
如何让全彩LED显示屏更加节能环保
随机推荐
阻止瀏覽器後退操作
如何通俗理解超级浏览器?可以用于哪些场景?有哪些品牌?
POJ 3176 cow bowling (DP | memory search)
shell脚本文件遍历 str转数组 字符串拼接
跨境电商是啥意思?主要是做什么的?业务模式有哪些?
AUTOCAD——遮罩命令、如何使用CAD对图纸进行局部放大
Detailed explanation of DDR4 hardware schematic design
Dynamic SQL of ibatis
[office] eight usages of if function in Excel
汉诺塔问题思路的证明
7 themes and 9 technology masters! Dragon Dragon lecture hall hard core live broadcast preview in July, see you tomorrow
Harbor image warehouse construction
[there may be no default font]warning: imagettfbbox() [function.imagettfbbox]: invalid font filename
Empêcher le navigateur de reculer
COMSOL -- 3D casual painting -- sweeping
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
Zcmu--1390: queue problem (1)
R3Live系列学习(四)R2Live源码阅读(2)
C language current savings account management system
Web API configuration custom route