how to synch 2 processes to start at the same time

Hey

Excuse me if this question is repeated everywhere but I am still new with scripting and I couldn't apply what I found to my case :confused::confused:

I am trying to run a rec process on a ssh client and at the same time play a file from my computer so i tried this

#!/bin/bash
echo "Start"
./play output.au
ssh an@192.168.0.4 rec aaa.au silence 1 0.3 1% 1 0.3 1% 

The problem is that the recording starts after the play command is done and the audio file is over.

Is there anyway I could start rec while the file is playing I can sustain a little delay but I need this delay to be a min. as possible

Thnx
Ahmed Taha

Hello,
Just put one in the background :

#!/bin/bash
echo "Start"
./play output.au &
ssh an@192.168.0.4 rec aaa.au silence 1 0.3 1% 1 0.3 1% 

or you can also put both in background and use wait :

#!/bin/bash
echo "Start"
./play output.au &
ssh an@192.168.0.4 rec aaa.au silence 1 0.3 1% 1 0.3 1% &
wait

Dimi3

#!/bin/bash
echo "Start"
# run the audio as a separate process
./play output.au  &
ssh an@192.168.0.4 rec aaa.au silence 1 0.3 1% 1 0.3 1%

Perfect, Thnx alot