如何一次性运行所有命令

问题描述 投票:0回答:1

我有一个脚本,看起来像这样

cd /root/signedsh/apps
for i in $(find . -name *_Seyed.ipa) ; do
#echo $i
./sign -k "/root/cert/appX.p12" -m "/root/profile/appX.mobileprovision" -p "udidsigning" -z 9 -o "$i" "$i"
done

现在,这在前10个文件中工作得很好,但现在我有300个文件,我需要在运行.sign命令时使用

目前,它等待第一条命令完成后,再运行第二条命令(for i in $(find . -name *_Seyed.ipa) ; do)

有没有办法可以同时运行全部300多个?服务器是48核,256GB ddr4,在一个大的nvme raid 0上,所以应该不会很吃力,只是不知道怎么做而已

bash centos tmux
1个回答
3
投票

在后台运行每个命令(不要使用 find):


shopt -s globstar
cd /root/signedsh/apps
for i in **/*_Seyed.ipa ; do
  ./sign -k "/root/cert/appX.p12" \
         -m "/root/profile/appX.mobileprovision" \
         -p "udidsigning" -z 9 -o "$i" "$i" &
done
© www.soinside.com 2019 - 2024. All rights reserved.