keep track of multiple terminals from shell script

user137717

I am writing a quick start shell script to automatically set up my development environment for a current project. However, none of the commands in the shell script can be executed after my server starts because it takes over the terminal. I am trying to open a new tab, start the server in there and then continue executing my shell script in the original tab. My script currently looks like this:

subl myProj
cd myProj
gnome-terminal --tab
npm start
google-chrome http://localhost:3000

myProj ends up opening in the new tab and the server starts in the original tab. chrome never launches.

Sergiy Kolodyazhnyy

Scripts execute commands in sequence, and wait until each command finishes. However, there is a way to allow the script to continue executing past a specific command - add & on the end of the script.

For instance:

!#/bin/bash
firefox
echo "Next line"

Will wait till firefox is closed.

!#/bin/bash
firefox &
echo "Next line"

Will execute echo command and allow keeping firefox open

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Shell script to copy and prepend folder name to files from multiple subdirectories

keep track of parent class from member imageview

How to write a shell script to open four terminals and execute a command in each?

Multiple shell script workers

How to keep track of multiple versions of assemblies?

Prolog - Keep track of multiple sum counters

How to keep track of multiple matches in drools

Keep track of multiple checkboxes react

How to run multiple Python/Shell scripts from one script

Shell script: if multiple conditions

Shell script to rename multiple files from their parent folders name

bash - Shell script opening multiple terminals and executing distinct commands

XQuery basics - how to keep track of multiple variables?

Efficient way to start multiple shell scripts from single shell script

How to start a gnome shell and run multiple commands from a script

Track multiple values from a method

Unable to start new gnome terminals from shell script when remotely logging in through ssh

Switching between terminals in a shell script

Keep track number of moves of element in array in Shell Sort C++

Keep track of list values in multiple loops

Gnuplot shell script ROS data from multiple files

Firing two terminals from a single bash script and both terminals output to two separate files

Running shell script to open two terminals and run commands in them

Run multiple new terminals from terminal

Creating multiple terminals in bash script and keep executing commands?

shell script with multiple variables

How can I start multiple vscode from c# and keep track of when they terminate?

How to activate ANSI shell script colors in Visual Studio Codium terminals?

Run multiple terminals from python script and execute commands (Ubuntu)