当前位置:网站首页>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 &
边栏推荐
- Idea set the number of open file windows
- 无密码身份验证如何保障用户隐私安全?
- 解决grpc连接问题Dial成功状态为TransientFailure
- Spark Tuning (I): from HQL to code
- 【Oracle】使用DataGrip连接Oracle数据库
- Install esxi 6.0 interactively
- Stop saying that microservices can solve all problems!
- POJ 3176-Cow Bowling(DP||记忆化搜索)
- [office] eight usages of if function in Excel
- 解决readObjectStart: expect { or n, but found N, error found in #1 byte of ...||..., bigger context ..
猜你喜欢
随机推荐
跨境电商是啥意思?主要是做什么的?业务模式有哪些?
Zcmu--1390: queue problem (1)
紫光展锐全球首个5G R17 IoT NTN卫星物联网上星实测完成
Technology sharing | common interface protocol analysis
Modulenotfounderror: no module named 'scratch' ultimate solution
技术分享 | 常见接口协议解析
Ddrx addressing principle
[leetcode] wild card matching
解决readObjectStart: expect { or n, but found N, error found in #1 byte of ...||..., bigger context ..
-26374 and -26377 errors during coneroller execution
Summary of websites of app stores / APP markets
What does cross-border e-commerce mean? What do you mainly do? What are the business models?
[advertising system] incremental training & feature access / feature elimination
Dynamic SQL of ibatis
AutoCAD -- mask command, how to use CAD to locally enlarge drawings
Summary of thread and thread synchronization under window
Web API configuration custom route
Question and answer 45: application of performance probe monitoring principle node JS probe
Manage multiple instagram accounts and share anti Association tips
The art of communication III: Listening between people







