我有一个文件,内容如下:
/path/to/file1
/path/to/file2
/path/to/file3
/path/to/file4我想使用gnu-parallel实用程序在每一行上并行运行一个命令,我知道它支持使用::::的文件输入。我不确定的是,我应该将哪些参数传递给gnu-parallel,以便按\n拆分文件内容并并行处理?
发布于 2018-08-15 01:27:15
这是man parallel
NAME
parallel - build and execute shell command lines from
standard input in parallel
SYNOPSIS
parallel [options] [command [arguments]] < list_of_arguments
[...]下面是这种调用形式的一个示例:
$ cat mylist.txt
/path/to/file1
/path/to/file2
/path/to/file3
/path/to/file4
$ parallel 'echo "I am processing:" {}' < mylist.txt
I am processing: /path/to/file1
I am processing: /path/to/file2
I am processing: /path/to/file3
I am processing: /path/to/file4https://stackoverflow.com/questions/51846640
复制相似问题