[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: [NOVICE] lade et script køre i given tid



In <sslug@sslug> Ivar Madsen <sslug@sslug> writes:

>Jeg vil nu godt have sat en gentagels lykke om, således at den spiller i det
>uendelige.
>scriptet skal så afbrydes efter det antal minutter som der angeves som
>parameter.

>Hvorledes gør jeg det smartes?

>Det første jeg lige kan komme på, er at kalde "at" inden lykkes startes, og
>så sætte systemmet til at slå processen ned med en "killall mplayer &&
>killall script"
>Men der må vel være noget smartere?



Noget a la

  #!/bin/bash

  TID=$1
  SEKUNDER=$[ $TID * 60 ]

  # Start mplayer som baggrunds-job
  mplayer .... &
  MPLAYERPID=$!

  # Vent, og stop mplayer
  sleep $SEKUNDER
  kill $MPLAYERPID

  exit 0



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-09-01, 02:04 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] *