我想使用以下代码与 aria2c 并行下载多个 torrent 文件:
me@host:~/Downloads$ find . -iregex ".*.torrent" | while read line; do nohup aria2c "$line" &; done
bash: syntax error near unexpected token `;'
解决子shell的问题
me@host:~/Downloads$ find . -iregex ".*.torrent" | while read line; do (nohup aria2c "$line" &); done
nohup: nohup: appending output to 'nohup.out'
appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
但是所有进程都在停止进程中
me@host:~/Downloads$ ps -aux | grep 'aria'| sed "s/$USER/me/g"
me 5807 0.1 0.4 86208 18392 pts/0 S 22:58 0:00 aria2c ./ebd9863a73a5ef22344550a650d169a1.torrent
me 5809 0.0 0.4 85804 17884 pts/0 S 22:58 0:00 aria2c ./53ef22110569d46b445a1e908a7ae88f.torrent
me 5811 0.1 0.4 87336 19408 pts/0 S 22:58 0:00 aria2c ./a51accbbf14c8a05cb82caa7d8bec0c6.torrent
me 5813 0.0 0.4 84260 16528 pts/0 S 22:58 0:00 aria2c ./0eae6a261a340b8af159c0155aa8fab6.torrent
me 5815 0.0 0.3 82972 14400 pts/0 S 22:58 0:00 aria2c ./bf93f4618ba007ff95113156c802812b.torrent
me 5817 0.0 0.4 84256 16376 pts/0 S 22:58 0:00 aria2c ./f5938dd24367ffaf766ef99928660786.torrent
me 5819 0.0 0.4 86132 18440 pts/0 S 22:58 0:00 aria2c ./61ee21f83a33b91674926daf70c34947.torrent
me 5821 0.0 0.4 84100 16296 pts/0 S 22:58 0:00 aria2c ./710fc8dc201568d807aa7709b8fa072a.torrent
me 5823 0.0 0.3 82972 14364 pts/0 S 22:58 0:00 aria2c ./2b9cc942c04a8063bd8d4d8fd98814d9.torrent
me 5825 0.0 0.4 85832 18340 pts/0 S 22:58 0:00 aria2c ./8ffc0566591e1258c151d4d28843c55b.torrent
me 5827 0.0 0.3 82972 15208 pts/0 S 22:58 0:00 aria2c ./d9e39bfe0a907ffb580a975d8c8719d2.torrent
me 5829 0.0 0.3 83692 15616 pts/0 S 22:58 0:00 aria2c ./EDBDB765D87586FDA75C4287A1E9EA1E.torrent
me 5933 0.0 0.0 11928 956 pts/0 S+ 23:04 0:00 grep --color=auto aria
怎么能把它搞定?