LinuxQuestions.org
Review your favorite Linux distribution.
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, 07: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, 07:52 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
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, 08: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, 08:16 PM   #4
Brian1
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: 61
You can use pkill command as well if on your system.
pkill museekd

Brian1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:37 PM
rookie at work hannible808 Linux - Software 2 11-28-2004 01:15 PM
rookie compiling zabir Linux - Newbie 1 09-24-2004 01:25 PM
hi, question of a rookie Killah Linux - Hardware 2 02-17-2004 03:10 PM
Linux Rookie woodyjohnson425 LinuxQuestions.org Member Intro 3 06-13-2003 08:57 PM


All times are GMT -5. The time now is 02:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration