Skip to main content
deleted 4 characters in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

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

#!/bin/bash
( ping 8.8.8.8 )
( ping 192.168.0.1 )
#!/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.1ping 8.8.8.8 & ping 192.168.0.1

But why did the above code peacepiece not work?

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?

I want to run several commands in parallel, but I have no idea why the following code piece 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 piece not work?

added 160 characters in body
Source Link
mkdrive2
  • 662
  • 2
  • 7
  • 15

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?

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?

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?

Source Link
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?