Вопрос по linux, bash – Запускать несколько команд одновременно в одном терминале

50

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Ваш Ответ

6   ответов
91

trap
wait $PID_LIST

#!/bin/bash

for cmd in "[email protected]"; do {
  echo "Process \"$cmd\" started";
  $cmd & pid=$!
  PID_LIST+=" $pid";
} done

trap "kill $PID_LIST" SIGINT

echo "Parallel processes have started";

wait $PID_LIST

echo
echo "All processes have completed";

parallel_commands

parallel_commands "cmd arg0 arg1 arg2" "other_cmd arg0 arg2 arg3"

parallel_commands "sleep 1" "sleep 2" "sleep 3" "sleep 4"

Error: User Rate Limit ExceededwaitError: User Rate Limit Exceeded
Error: User Rate Limit Exceededparallel?
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededwaitError: User Rate Limit Exceeded Oliver Zheng
Error: User Rate Limit Exceeded
28

(echo command1; echo command2) | parallel
parallel ::: command1 command2

parallel ::: command1 command2 &
PID=$!
kill -TERM $PID
kill -TERM $PID
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededgnu.org/software/parallel
2

sleep%:
        sleep $(subst sleep,,[email protected])
        @echo [email protected] done.

-j

$ make -j sleep3 sleep2 sleep1
sleep 3
sleep 2
sleep 1
sleep1 done.
sleep2 done.
sleep3 done.

-j

$ make -j sleep3 sleep2 sleep1
sleep 3
sleep3 done.
sleep 2
sleep2 done.
sleep 1
sleep1 done.

$ make -j -n sleep3 sleep2 sleep1
sleep 3
sleep 2
sleep 1
1

par "script1.sh" "script2.sh" "script3.sh"

par "PARPREFIX=[script1] script1.sh" "script2.sh" "script3.sh"
Error: User Rate Limit Exceededparallel ::: "script1.sh" "script2.sh" "script3.sh"Error: User Rate Limit Exceededparallel --tag ::: "script1.sh" "script2.sh" "script3.sh"
Error: User Rate Limit Exceeded
-8

&&command1 && command2

gnome-terminal -e "command1" && gnome-terminal -e "command2"

command1command2

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededcommand2 after command1Error: User Rate Limit Exceededcommand1Error: User Rate Limit Exceededsleep 3 && sleep 3Error: User Rate Limit Exceeded
42

&

$ sleep 3 & sleep 5 & sleep 2 &

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded&!Error: User Rate Limit Exceeded&Error: User Rate Limit Exceeded

Похожие вопросы