Skip to main content
2 of 3
added 160 characters in body
mkdrive2
  • 662
  • 2
  • 7
  • 15

Subshells not working

I want to run several commands in parallel, but I have no idea why the following code peace does not work.

#!/bin/bash
( ping 8.8.8.8 )
( ping 192.168.0.1 )

It completely ignores the second ping command. Why is that so?

Edit: OK, now I know that you can run them in parallel by doing &.

ping 8.8.8.8 & ping 192.168.0.1

But why did the above code peace not work?

mkdrive2
  • 662
  • 2
  • 7
  • 15