LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-17-2005, 06:42 PM   #1
muddywaters
Member
 
Registered: May 2005
Location: Winnipeg, Canada
Distribution: mostly mepis
Posts: 427

Rep: Reputation: 30
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.
 
Old 10-17-2005, 06:52 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 10-17-2005, 07:06 PM   #3
muddywaters
Member
 
Registered: May 2005
Location: Winnipeg, Canada
Distribution: mostly mepis
Posts: 427

Original Poster
Rep: Reputation: 30
The space didn't seem to cause a problem but I will remember that for next time. Will try that kill line. Thanks much.
 
Old 10-17-2005, 07:16 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
You can use pkill command as well if on your system.
pkill museekd

Brian1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mepis Rookie kraydl MEPIS 10 10-23-2005 06:37 PM
rookie at work hannible808 Linux - Software 2 11-28-2004 12:15 PM
rookie compiling zabir Linux - Newbie 1 09-24-2004 12:25 PM
hi, question of a rookie Killah Linux - Hardware 2 02-17-2004 02:10 PM
Linux Rookie woodyjohnson425 LinuxQuestions.org Member Intro 3 06-13-2003 07:57 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration