[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] stop process som køre i baggrunden



sslug@sslug (Mikkel Meinike Nielsen), 2011-07-17 21:52 (+0200):

> Hvis jeg nu viser et billed fra min terminal (rxvt) med imageviewer
> programmet feh og gør dette i baggrunden
>
> feh mitbilled.jpg &
>
> kan jeg så "dræbe" den process igen uden at skulle igennem noget
> kompliceret med ps, grep og sed og kill? Jeg ville gerne gøre det i et
> script. 

Förstår jag rätt att du vill starta feh i samma script? Du kan göra så
här:

  #! /bin/sh

  feh mitbilled.jpg &
  kill $!

fast det är kanske snarare så här du vill göra om du skall starta mer
saker i samma script:

  #! /bin/sh

  feh mitbilled.jpg &
  fehpid=$!

  ...

  kill $fehpid

OBS! Allt otestat!

$! expanderar alltså till process ID för senaste bakgrundsprocessen.

-- 
http://hack.org/mc/
Use plain text e-mail, please. OpenPGP welcome, 0xE4C92FA5.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-08-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *