LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Rookie needs script help (https://www.linuxquestions.org/questions/programming-9/rookie-needs-script-help-374068/)

muddywaters 10-17-2005 06:42 PM

Rookie needs script help
 
Most of you programmers may laugh at this, but I've never tried to write a shell script before so please bear with me.
I downloaded a p2p program named Museek that has 2 parts. Museekd is a daemon that connects to the Soulseek network. Museeq is the graphical frontend. I wanted to launch Museeq from Kmenu so I stole pieces of other scripts and put this together;

#! /bin/bash
# museek startup
museekd &
museeq
kill `ps x | grep -w "museek[d]" | cut -c1-6`

I know this is probably rubbish but it works (so far). My question is how would this be constructed in a proper script ? Just the general idea please, I want to try to work out the details myself. Thanks for any suggestions.

Tinkster 10-17-2005 06:52 PM

That's basically it, just get rid of the space between the
#! and the /bin/bash

Also a "skill -9 museekd" is slightly prettier than your
approach ;}


Cheers,
Tink

muddywaters 10-17-2005 07:06 PM

The space didn't seem to cause a problem but I will remember that for next time. Will try that kill line. Thanks much. :)

Brian1 10-17-2005 07:16 PM

You can use pkill command as well if on your system.
pkill museekd

Brian1


All times are GMT -5. The time now is 07:22 PM.