Parallel processing or threading in Shell scripting

后端 未结 3 1672
眼角桃花
眼角桃花 2020-12-29 12:59

I am writing a script in shell in which a command is running and taking 2 min. everytime. Also, there is nothing we can do with this. But if i want to run this command 100 t

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 13:28

    GNU Parallel is what you want, unless you want to reinvent the wheel. Here are some more detailed examples, but the short of it:

    ls | parallel gzip # gzip all files in a directory
    

提交回复
热议问题