[ILUG] Script Query
Ian
ianhoweire at gmail.com
Sun Apr 6 23:56:41 IST 2008
regarding the browser crashing instead of closing. I ran into this issue and
it can be overcome by setting this behavior in 'http://about:config'
there is a setting here called : browser.sessionstore.resume_from_crash that
you can make false.
i want to create a script that opens a webpage, closes after 1 minute and
opens a different page, this should happen over and over again? anyone any
ideas how i should set this up?
Ian
On 06/04/2008, Colm Buckley <colm at tuatha.org> wrote:
>
> On Sun, Apr 6, 2008 at 12:29 PM, Ian <ianhoweire at gmail.com> wrote:
>
>
> > I'm basically launching a program in the background using a sh script.
> >
> > firefox http://www.google.ie
> >
> > (side note: this also launches the terminal, is there a way to prevent
> > this?)
>
>
> It *shouldn't* launch a terminal, to be honest, unless your environment
> decides that it needs somewhere to put the output of the command. What
> environment is this (KDE, GNOME, etc?) and what are you using to launch the
> shell script?
>
> then i want to have another script that can kill the process.
> > I presume i am only able to kill the process using the pid using the
> > format
> > 'kill 1234'
> > I can use the following line to copy the pid to a file
> >
> > ps -e | grep firefox-bin | cut -d ' ' -f2 > ~/processID
> >
> > how then can i pass the entry in processID to the kill command.
> > Or if there is another way to do this i''m all ears.
>
>
> killall firefox-bin
>
> Or, if you really do want to do it using the above:
>
> kill `ps -e | grep firefox-bin | cut -d ' ' -f2`
>
> Note the backticks. Most modern shells will also allow $(), so:
>
> kill $(ps -e | grep firefox-bin | cut -d ' ' -f2)
>
> will also work. killall is easier, though. Note : I believe the Linux
> killall has different semantics from the Unix one; if you run killall on
> (eg:) a Solaris system, it will send a signal to all processes, not just the
> named ones.
>
> Colm
>
>
>
>
> >
> >
> > Ian
> > --
> > Irish Linux Users' Group mailing list
> > About this list : http://mail.linux.ie/mailman/listinfo/ilug
> > Who we are : http://www.linux.ie/
> > Where we are : http://www.linux.ie/map/
> >
>
>
>
> --
> Colm Buckley / colm at tuatha.org / +353 87 2469146
More information about the ILUG
mailing list