From a .command file, I want to write steps so that multiple terminal tabs are opened and in each of those tabs a long running command is run and then my .command file should complete without stopping those long running commands.
Is such a requirement possible in terminal?
The below script does not work but I wanted to do something like the below steps:
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down'
APP_BASE_LOCATION="/somepath"
cd $APP_BASE_LOCATION/app1
mvn spring-boot:run
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down'
APP_BASE_LOCATION="/somepath"
cd $APP_BASE_LOCATION/app2
npm start
&&(careful: if any command in the chains returns error, next ones will not be executed) or using;between two commands. so I think you can wrap the these two blocks in individual functions which you can call in one line. – anki Jun 04 '20 at 07:56