我在 bash 脚本中遇到了以下代码。
# See if bsdtar can recognize the file
if bsdtar -tf "$file" -q '*' &>/dev/null; then
cmd="bsdtar"
else
continue
“-q”选项是什么意思?我在 bsdtar 命令的帮助信息中没有找到任何信息。
谢谢!
从 bsdtar手册页:
-q (--fast-read) (x and t mode only) Extract or list only the first archive entry that matches each pattern or filename operand. Exit as soon as each specified pattern or filename has been matched. By default, the archive is always read to the very end, since there can be multiple entries with the same name and, by convention, later entries overwrite earlier entries. This option is provided as a performance optimization.