How do you run a command for each line of a file?

前端 未结 9 1534
梦谈多话
梦谈多话 2020-11-27 10:30

For example, right now I\'m using the following to change a couple of files whose Unix paths I wrote to a file:

cat file.txt | while read in; do chmod 755 \"         


        
9条回答
  •  抹茶落季
    2020-11-27 10:52

    If you want to run your command in parallel for each line you can use GNU Parallel

    parallel -a  
    

    Each line of your file will be passed to program as an argument. By default parallel runs as many threads as your CPUs count. But you can specify it with -j

提交回复
热议问题