From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org)
	by nuthatch.gentoo.org with esmtp (Exim 4.54)
	id 1FO9hI-0000IQ-Pp
	for garchives@archives.gentoo.org; Tue, 28 Mar 2006 08:37:05 +0000
Received: from robin.gentoo.org (localhost [127.0.0.1])
	by robin.gentoo.org (8.13.6/8.13.5) with SMTP id k2S8YfEN022085;
	Tue, 28 Mar 2006 08:34:41 GMT
Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30])
	by robin.gentoo.org (8.13.6/8.13.5) with ESMTP id k2S8Kad8004797
	for <gentoo-user@lists.gentoo.org>; Tue, 28 Mar 2006 08:20:52 GMT
Received: from charybdis.rus.uni-stuttgart.de ([129.69.1.58])
	by smtp.gentoo.org with esmtp (Exim 4.54)
	id 1FO9Kp-0002t2-N3
	for gentoo-user@lists.gentoo.org; Tue, 28 Mar 2006 08:13:51 +0000
Received: from localhost (localhost [127.0.0.1])
	by charybdis.rus.uni-stuttgart.de (Postfix) with ESMTP id AD91F342F27
	for <gentoo-user@gentoo.org>; Tue, 28 Mar 2006 10:13:50 +0200 (CEST)
Received: from charybdis.rus.uni-stuttgart.de ([127.0.0.1])
 by localhost (charybdis [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 10882-01-80 for <gentoo-user@gentoo.org>;
 Tue, 28 Mar 2006 10:13:48 +0200 (CEST)
Received: from uni-stuttgart.de (mbox.uni-stuttgart.de [129.69.1.9])
	by charybdis.rus.uni-stuttgart.de (Postfix) with ESMTP id 7923E342F1C
	for <gentoo-user@gentoo.org>; Tue, 28 Mar 2006 10:13:48 +0200 (CEST)
X-Virus-Scanned: by mbox.uni-stuttgart.de
Received: from [129.69.11.67] (account ruslucas@po2.uni-stuttgart.de HELO gentoo.rus.uni-stuttgart.de)
  by uni-stuttgart.de (CommuniGate Pro SMTP 4.2.8)
  with ESMTP-TLS id 38194231 for gentoo-user@gentoo.org; Tue, 28 Mar 2006 10:13:34 +0200
Date: Tue, 28 Mar 2006 10:13:32 +0200 (CEST)
From: Sascha Lucas <sascha.lucas@rus.uni-stuttgart.de>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] OT: bash scripting: implement uninterruptable sleep
Message-ID: <Pine.LNX.4.64.0603281004080.30414@tragbb.ehf.hav-fghggtneg.qr>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Virus-Scanned: by amavisd-new at charybdis.rus.uni-stuttgart.de
X-Spam-Status: No, hits=-4.399 tagged_above=-999 required=5 tests=ALL_TRUSTED,
 BAYES_00
X-Spam-Level: 
X-Archives-Salt: 8d282465-585e-4d30-a128-ba4ea0614906
X-Archives-Hash: c6f3e9f1f0a13dc14fe4ac006ad92fb3

Hi List,

I have a shell script and want a uninterruptable sleep. /usr/bin/sleep 
itself seems to have its own signal handlers. How is it possible to sleep 
uninterruptable?

#!/bin/bash
trap "echo 'Ctrl+C should not work'" INT

for foo in 1 2 3; do
 	echo $foo
 	sleep 10
done
## end of script

TIA,

Sascha.
-- 
gentoo-user@gentoo.org mailing list