I want to open 2 chromium tabs using this script:
#!/bin/bash
#chromium is not open
chromium-browser '
sleep 2
chromium-browser '
sleep 2It opens the first tab but in order to open the second tab I have to manually close chromium or else it will not continue. Why is this happening? I do not want the tabs to open at the same time and that is why I put 'sleep' in between the chromium-browser commands. The browser is originally closed. If the browser is open then the tabs open the way I want them to.
edit: I'm using ubuntu 16.04
edit2: I simplified the question
1 Answer
What you should do is to add an & and the end of chromium-browser '.
The & informs the shell to put the command in the background, your shellscript should look like this:
#!/bin/bash
chromium-browser '
sleep 2
chromium-browser '
sleep 2You have to send the task to the background because otherwise the terminal can not execute the commands after your first call tochromium-browser '
Hope this helps.
2