我正在尝试在嵌套的for循环内进行迭代的skopeo
复制。该命令无法识别我在循环内设置的变量。我尝试过:
for i in list_files.txt; do
image_name=$(cat list_files.txt | sed -e 's/\-[^*]*$//')
for i in list_files.txt; do
version=$(cat list_files.txt | sed -e 's/[^0-9.]*//' | sed 's/.tar//')
tar_name=$(cat list_files.txt)
skopeo copy \
docker-archive:/opt/app-root/src/$tar_name \
docker://private/dsop/test/$image_name:$version \
--dest-creds=$USERNAME:$PASSWORD \
--dest-tls-verify=false
done
done
为什么我不能使用设置的变量?
我收到错误消息:
FATA[0000] Exactly two arguments expected