I'm looking to run a number of background processes in a loop, but only want to wait for all of those processes to finish, still allowing another background process to continue. 

After doing some research, I only see solutions that would require me to list every process ID I wish to `wait` for instead of matching them inversely against a single process ID. It seems that something like `wait != $pid` would be very useful.

example script:

```
#!/bin/bash

command1 &
pid=$!
for i in ${array[@]}; do
    for n in $(seq 3); do
        if [ $n -eq 1 ];
            command2 > file &
        else
            command2 >> file &
        fi
    done
done

```

In this example I'm looking to wait for every process to finish except `$pid` without having to list them all using the `wait` command. Is this possible?