Shell已经对现成的glob进行了排序。因此,对于以下任一情况:
# works only if the number of names is short enough to fit in one invocation
cat * >../output.txt
Run Code Online (Sandbox Code Playgroud)
...或者,其表亲支持的名称超过了单个命令行中的名称...
# works for any arbitrary number of names
printf '%s\0' * | xargs -0 cat >../output.txt
Run Code Online (Sandbox Code Playgroud)
...输出已根据中定义的排序顺序进行排序LC_COLLATE(该变量ls在执行的任何排序中都应遵循)。
| 归档时间: |
|
| 查看次数: |
69 次 |
| 最近记录: |