修复最后一行没有换行符的情况

This commit is contained in:
tech-shrimp 2024-06-13 15:11:14 +08:00
parent 8eec8b76fd
commit 721c59dffb

View File

@ -61,7 +61,7 @@ jobs:
# 数据预处理,判断镜像是否重名 # 数据预处理,判断镜像是否重名
declare -A duplicate_images declare -A duplicate_images
declare -A temp_map declare -A temp_map
while IFS= read -r line; do while IFS= read -r line || [ -n "$line" ]; do
# 忽略空行与注释 # 忽略空行与注释
[[ -z "$line" ]] && continue [[ -z "$line" ]] && continue
if echo "$line" | grep -q '^\s*#'; then if echo "$line" | grep -q '^\s*#'; then
@ -99,7 +99,7 @@ jobs:
done < images.txt done < images.txt
while IFS= read -r line; do while IFS= read -r line || [ -n "$line" ]; do
# 忽略空行与注释 # 忽略空行与注释
[[ -z "$line" ]] && continue [[ -z "$line" ]] && continue
if echo "$line" | grep -q '^\s*#'; then if echo "$line" | grep -q '^\s*#'; then