I want to create a Shell script (.sh) using MacOS and LinuxOS (respectively). This is what I have made:
#!/bin/bash
redis-server &
mongod &
cd ~/some/path && npm start &
cd ~/some/path && ./ngrok http 3000 -region=eu &
echo "My Workspace has been started"
I want redis-server to be running in background, and only by the time that the redis-server was fully initiated I want then to run the mongod service. And so for and so on.
At the end of the script I want to see the My Workspace has been started log on the Terminal.
What happens now is that it runs all of them together, I can see mixin logs in the Terminal of the redis, and then of the mongo and then some from the npm and etc.
How can I achieve this?