[fgmlug] Re: Bash scripting question

  • From: Richard Zimmerman <ke4rit@xxxxxxxxx>
  • To: fgmlug@xxxxxxxxxxxxx
  • Date: Thu, 26 Aug 2010 16:03:01 -0700 (PDT)

Comments inline...
 ---
Richard "Goose" Zimmerman, ke4rit
Mishawaka, IN




________________________________
From: chuq <chuq00@xxxxxxxxx>
To: fgmlug@xxxxxxxxxxxxx
Sent: Thu, August 26, 2010 3:27:10 PM
Subject: [fgmlug] Bash scripting question

-----------------------
As I am still new to programming and writing bash scripts I have a question for 
you guys to see if you can give me a hand with this..
What I would like to accomplish is this (if any part of this is not do able 
that 
is fine I can make do with what won't work)
I want to type a command such as ./start
from there I would like for it to run a command (gpsd)
-----------------------


<start>
#!/bin/bash
/location/to/gpsd

-----------------
Then have it open another console tab and run a different program (kismet)
------------------


Within <start>

./location/to/kismet
*or*
./location/to/script2
# spawns kismet 

----------------------
That is the biggest part of what I want, here is the parts that may get tricky
I would like to have the script stop (ctrl-c is fine) when I stop the second 
program (kismet)
------------------------


When you exit kismet the original start script will end automatically... Are 
you 
really wanting to end gpsd instead????


--------------------------
And then if this is still yet possible have it run a different script (./done) 
when both of those are done.
--------------------------


in ./done use the killall command to kill all instances of gpsd or leave 
killall 
in ./start

--------------------------------
Any help on this would be appreciated..
I have managed to write a few small scripts that help me out with running the 
programs with different variable or arguments in them, but I am stumped on 
this. 
The one thing that I have not been able to figure out is how to have bash 
initialize another console window.
-----------------------------

If you want another console just ./bin/bash


-------------
Thanks very much
Chuq 
-------------

Hopes this helps...

Richard


      

Other related posts: