小编pie*_*oni的帖子

无法理解这个 bash shell 参数扩展

对以下命令完全疯狂:

declare -a partition_files
readarray -d '' partition_files < <(find "$choosen_image_folder" -name "*sda${i}.gz*")

# this does not work
/bin/cat "${partition_files[*]}" | /bin/gunzip -f -c | ntfsclone -r -O "/dev/sda$i" -
# this does work
/bin/cat ${partition_files[*]} | /bin/gunzip -f -c | ntfsclone -r -O "/dev/sda$i" -
# this does not work
/usr/sbin/partimage restore -b "/dev/sda$i" "${partition_files[*]}"
# this does work
/usr/sbin/partimage restore -b "/dev/sda$i" ${partition_files[*]}
Run Code Online (Sandbox Code Playgroud)

为什么在这种情况下删除引用有效而引用无效?

bash quoting

3
推荐指数
1
解决办法
95
查看次数

标签 统计

bash ×1

quoting ×1