来自https://unix.stackexchange.com/a/458074/674
请记住-- 在将任意参数传递给命令时使用(或在可能的情况下使用重定向)。所以sort -- "$f1"或更好,sort < "$f1"而不是sort "$f1".
--
sort -- "$f1"
sort < "$f1"
sort "$f1"
为什么首选使用--和重定向?
为什么是sort < "$f1"首选sort -- "$f1"?
为什么是 sort -- "$f1"首选sort "$f1"?
谢谢。
command-line shell io-redirection arguments
arguments ×1
command-line ×1
io-redirection ×1
shell ×1