1

I try to run multiple commands in background, but those commands have multiple commands inside

startFFMPEG=$(/root/bin/ffmpeg -i cmd1__________ || /root/bin/ffmpeg -i cmd2__________ || /root/bin/ffmpeg -i cmd3__________ || )

$startFFMPEG
echo "PRINT THIS so i can continue to run another commands" 

So what I try to make is:

When I run the bash script, it will run startFFMPEG which contains multiple comands (and if 1 fail will start another).

But I don't want to wait for them, I want the script to continue before waiting for it.

So in my case echo "PRINT" is never shown

1 Answer 1

4

Kind of sounds like you want a function that you can run in the background:

startFFMPEG() {
     /root/bin/ffmpeg -i cmd1__________ \
  || /root/bin/ffmpeg -i cmd2__________ \
  || /root/bin/ffmpeg -i cmd3__________ 
}

startFFMPEG &
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.