Consider this example:
#!/usr/bin/env bash
echo "[Status] $(killall --wait example)"
Expected output:
[Status] example: no process found
Actual result (being wrong order and 2 lines):
example: no process found
[Status]
result=$(killall --wait example 2>&1)
echo "[Status] ${result}"
Change:
echo "[Status] $(killall --wait example)"
into:
echo "[Status] $(killall --wait example 2>&1)"
Explanation: killall
prints out on standard error instead of standard output.