Article View: es.comp.os.linux.programacion
Article #13301Re: Thread en un script bash
From: J.A. Gutierrez
Date: Thu, 08 Mar 2001 15:04
Date: Thu, 08 Mar 2001 15:04
40 lines
2225 bytes
2225 bytes
TvX <tovaritx@tovaritx.red> wrote:
: Hola, quiz� sea una pregunta irresoluble, pero me gustar�a saber si hay
: alguna manera de hacer que en un script bash se ejecute cada cierto
: tiempo una funcion o comando.
eso lo tiene zsh
periodic
If the parameter PERIOD is set, this function is exe-
cuted every PERIOD seconds, just before a prompt.
si no, a base de trap y kill supongo que tambien se podra
hacer...
: Por cierto, tambi�n me vendr�a muy bien un comando parecido a:
: read tecla
: pero que no tuviera eco y que no hubiera que pulsar enter al final. Creo
: que las opciones de read no dan para m�s...
#!/bin/sh
ReadKey()
{
Oldstty=`stty -g`
stty -icanon -echo min 1 time 0
dd bs=1 count=1 2>/dev/null
stty $Oldstty
}
key=`ReadKey`
echo $key
--
PGP and other useless info at \ La ciencia-ficcion es
http://www.cps.unizar.es/~spd/ \ ese futuro en el que
finger://daphne.cps.unizar.es/spd \ lo seguro es que ya
ftp://ivo.cps.unizar.es/pub/ \ (F. Alfaro) no seremos jovenes
Technical Details
Message-ID:
<98871c$nrj$1@news.unizar.es>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!news!news.rediris.es!news.unizar.es!not-for-mailReferences:
<slrn9aevu3.212.tovaritx@su27.tovaritx.red>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,6c1786098beee5a2
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-03-08 06:52:25 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!news!news.rediris.es!news.unizar.es!not-for-mail
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Thread en un script bash
Date: 8 Mar 2001 15:04:12 GMT
Organization: Rank
Lines: 40
Message-ID: <98871c$nrj$1@news.unizar.es>
References: <slrn9aevu3.212.tovaritx@su27.tovaritx.red>
NNTP-Posting-Host: daphne.cps.unizar.es
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.unizar.es 984063852 24435 155.210.152.20 (8 Mar 2001 15:04:12 GMT)
X-Complaints-To: usenet@news.unizar.es
NNTP-Posting-Date: 8 Mar 2001 15:04:12 GMT
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (IRIX/6.2 (IP22))