Splitting command line args with GNU parallel

后端 未结 3 915
一个人的身影
一个人的身影 2021-02-02 06:37

Using GNU parallel: http://www.gnu.org/software/parallel/

I have a program that takes two arguments, e.g.

$ ./prog file1 file2
$ ./prog file         


        
3条回答
  •  清歌不尽
    2021-02-02 06:57

    In Parallel's manual, it is said:

    If no command is given, the line of input is executed ... GNU parallel can often be used as a substitute for xargs or cat | bash.

    So take a try of:

    generate command | parallel
    

    Try to understand the output of this:

    for i in {1..5};do echo "echo $i";done | parallel
    

提交回复
热议问题