当前位置:网站首页>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 &
边栏推荐
- 基础篇——基础项目解析
- Operators
- How to make full-color LED display more energy-saving and environmental protection
- Some understandings of heterogeneous graphs in DGL and the usage of heterogeneous graph convolution heterographconv
- LDAP overview
- Web3基金会「Grant计划」赋能开发者,盘点四大成功项目
- 第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
- 如何让全彩LED显示屏更加节能环保
- FreeRTOS 中 RISC-V-Qemu-virt_GCC 的调度时机
- 基于昇腾AI丨爱笔智能推出银行网点数字化解决方案,实现从总部到网点的信息数字化全覆盖
猜你喜欢
9、 Disk management
赛克瑞浦动力电池首台产品正式下线
R3Live系列学习(四)R2Live源码阅读(2)
Based on shengteng AI Yisa technology, it launched a full target structured solution for video images, reaching the industry-leading level
Go language-1-development environment configuration
Explanation of message passing in DGL
DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法
32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
[JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output
Some understandings of heterogeneous graphs in DGL and the usage of heterogeneous graph convolution heterographconv
随机推荐
A mining of edu certificate station
regular expression
2022 Pengcheng cup Web
Summary of websites of app stores / APP markets
C # to obtain the filtered or sorted data of the GridView table in devaexpress
How to make full-color LED display more energy-saving and environmental protection
Scaffold development foundation
SQL Server monitoring statistics blocking script information
2021年山东省赛题库题目抓包
Lombok makes ⽤ @data and @builder's pit at the same time. Are you hit?
【Office】Excel中IF函数的8种用法
DGL中的消息传递相关内容的讲解
9、 Disk management
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
Detailed explanation of DDR4 hardware schematic design
Repair animation 1K to 8K
Bidirectional RNN and stacked bidirectional RNN
Share Net lightweight ORM
Three suggestions for purchasing small spacing LED display
How to close the log window in vray5.2