🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #14811

Re: Duda sobre el wait del bash

#14811
From: J.A. Gutierrez
Date: Fri, 29 Sep 2000 00:00
35 lines
1927 bytes
Han Solo <hsolo@maptel.es> wrote:

: #!/bin/bash

: exec /usr/sbin/sendmail -q &
: exec /usr/sbin/get-news >/home/hsolo/noticias 2>&1 &

	por que "exec" ???

: su hsolo -c '/usr/bin/fetchmail -v > /home/hsolo/resultado 2>&1 &'
: su hsolo -c '/usr/bin/weex 1 >/home/hsolo/weex.log 2>&1 &'

	al hacer un "su -c" estas lanzando el shell de "hsolo" y
	ejecutando el comando en background respecto a este shell.

: wait

	Por lo tanto, este wait espera a "su" (que termina instantaneamente),
	no a los hijos de shell de "hsolo"

	Solucion: trivial: saca el '&' fuera de la cadena que le
	pasas a "su"

: Por cierto, este comportamiento an�malo yo creo que se produce desde
: la actualizaci�n a potato.

	no creo que sea anomalo, lo anomalo me parece a mi lo de antes...
	Supongo que en potato han acutalizado el bash, y ahora ya
	se porta mas POSIX-correcto.

-- 
PGP and other useless info at      \                 Oh, show us the way
http://www.cps.unizar.es/~spd/      \             to the next whisky bar
finger://daphne.cps.unizar.es/spd    \                      Weill/Bretch
es doloroso ser sabio y descubrir la sopa de ajo                   (Pla)
Technical Details
Message-ID: <8r1kt6$r2l$1@news.unizar.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <87d7ho8csv.fsf@alderaan.maptel.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,4d8bcc2bc7258295
X-Google-Attributes: gidf86c8,public
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Subject: Re: Duda sobre el wait del bash
Date: 2000/09/29
Message-ID: <8r1kt6$r2l$1@news.unizar.es>
X-Deja-AN: 675448679
Content-Transfer-Encoding: 8bit
References: <87d7ho8csv.fsf@alderaan.maptel.es>
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: usenet@news.unizar.es
X-Trace: news.unizar.es 970217190 27733 155.210.152.20 (29 Sep 2000 08:46:30 GMT)
Organization: Rank
Mime-Version: 1.0
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (IRIX/6.2 (IP22))
NNTP-Posting-Date: 29 Sep 2000 08:46:30 GMT
Newsgroups: es.comp.os.linux.programacion