13

I'm making a shell script that will start bunch on programs that l mostly use. I wants commands for them the programs are- 1. skype 2. sublime-text 3. google-chrome 4. Beyond-comopare 5. scudCloud 6. Lampp

i've found some of them-

#! /bin/sh
sudo service mysql stop
sudo /opt/lampp/lampp start
sudo /usr/bin/skype start
sudo /usr/bin/subl start
sudo google-chrome

I know the application can be set from startup application also but i need to run some command also.

After running command bash shell script will run.

9
  • 1
    Possible duplicate of How do I start applications automatically on login? Oct 8, 2015 at 8:28
  • @Serg No actually i need to run some command also like this 'service mysql stop' i can't set that things by startup application. Oct 8, 2015 at 8:31
  • 1
    It is a bit unclear: when you want to start these applications (log in?) and why are you using sudo? Also: what should we think of when you say: but i need to run some command also? Oct 8, 2015 at 8:31
  • @JacobVlijm want them when ever i run the bash file, not automatically. Oct 8, 2015 at 8:33
  • So you also created the solution, didn't you? Or what doesnt work? Oct 8, 2015 at 8:46

2 Answers 2

9

Your script with further two entries:

$ cat launchscript.sh
#! /bin/sh
sudo service mysql stop
sudo /opt/lampp/lampp start
sudo /usr/bin/skype start
sudo /usr/bin/subl start
sudo google-chrome
sudo scudcloud 
sudo bcompare

Make it executable:

sudo chmod +x launchscript.sh

Run it:

./launchscript.sh
4
  • If $ scudcloud or $ bcompare doesn't work, you have installed/configured the programs wrongly. Oct 8, 2015 at 9:21
  • This are not proper commands to start those application, sudo /opt/lampp/lampp start sudo /usr/bin/skype start sudo /usr/bin/subl start. Oct 8, 2015 at 9:35
  • @ErrHunter I do not know anything of his configurations and so i just added the two cmds for the missing programs, seemed to work however Oct 8, 2015 at 10:10
  • You can even use this to open the exact same files, i.e.: xdg-open /path/to/your/file Also remember that some programs enable you to save your session/project which you can load later.
    – user30850
    Feb 6, 2023 at 4:58
0

Put the script to run all the services inside init.d directory to make them run at startup.

3
  • i don't want them to run on startup i want to create a .sh file so that when ever i run that file the programs and command runs, i have found commands for some of them and i want commands for beyond-compare and scudcloud Oct 8, 2015 at 9:11
  • Your question is unclear. if you want to run the services when you are running the script, then the script you have written will work.
    – Bidyut
    Oct 8, 2015 at 9:18
  • after running command bash <my shell script name> shell script will run. Oct 8, 2015 at 9:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .