Karnivaurus
Karnivaurus

Reputation: 24131

Running two programs from command line with a wait

I want to run two different programs from the command line in Ubuntu. Each has its own set of arguments. However, I want to wait for 5 seconds between launching the first program and the second. How can I enforce this wait?

Thus far, I have:

$ ./Program1 -a -b && ./Program2 -c -d

But I need to insert a wait between the two programs, and I want to do this all in one line on the command line. Is this possible?

Upvotes: 0

Views: 89

Answers (1)

user1723095
user1723095

Reputation: 1219

Yes it's possible:

./Program1 -a -b && sleep 5 && ./Program2 -c -d

Upvotes: 1

Related Questions