From owner-freebsd-questions@FreeBSD.ORG Thu Jan 27 13:34:59 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D52D106564A for ; Thu, 27 Jan 2011 13:34:59 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id D695E8FC13 for ; Thu, 27 Jan 2011 13:34:58 +0000 (UTC) Received: by iyb26 with SMTP id 26so1505754iyb.13 for ; Thu, 27 Jan 2011 05:34:58 -0800 (PST) Received: by 10.231.35.68 with SMTP id o4mr932463ibd.118.1296135297989; Thu, 27 Jan 2011 05:34:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.143.1 with HTTP; Thu, 27 Jan 2011 05:34:37 -0800 (PST) In-Reply-To: References: From: Eitan Adler Date: Thu, 27 Jan 2011 08:34:37 -0500 Message-ID: To: Aryeh Friedman Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD Mailing List Subject: Re: OT: How to set a timeout for a process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:34:59 -0000 On Thu, Jan 27, 2011 at 3:37 AM, Aryeh Friedman wrote: > I have a script that may or not hang (the reasons why it hangs are > unimportant here) and need to call it from an other script and need to > say if it hangs to give up after X seconds and just continue the > script (no harm done if it fails) If you are willing to be bash specific: http://www.bashcookbook.com/bashinfo/source/bash-4.0/examples/scripts/timeout3 I'm not exactly sure how to do it in a normal POSIX shell. -- Eitan Adler