I have a bash script which is calling three different commands and that execution must happen in one shell. I got it by adding && after each command like as follows-
CMD1 && CMD2 && CMD3
Now what i need is- lets say i open a terminal on my MAC machine, all commands should run in open shell not in new sub-shell.
As a side note- CMD1 is actually a source command to my project directory which is a bash script which sets all the environment variable for running server.
First, you will need to save save the command in a scriptfile, for example Myscript.sh
.
Second, you can execute the script file to run your commands simultaneously using
. ./Myscript.sh
The first .
stands for current shell and the second .
for current directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With