我正在尝试学习GNU Parallel,因为我有一个案例,我认为我可以轻松地并行化bash函数.所以在尝试学习的时候,我去了GNU Parallel手册,里面有一个例子 ......但我甚至无法让它工作!以机智:
(232) $ bash --version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
(233) $ cat tpar.bash
#!/bin/bash
echo `which parallel`
doit() {
echo Doing it for $1
sleep 2
echo Done with $1
}
export -f doit
parallel …
Run Code Online (Sandbox Code Playgroud)