From owner-freebsd-questions@FreeBSD.ORG Tue Dec 26 23:26:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C082C16A403 for ; Tue, 26 Dec 2006 23:26:31 +0000 (UTC) (envelope-from kelly.terry.jones@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by mx1.freebsd.org (Postfix) with ESMTP id 838B213C473 for ; Tue, 26 Dec 2006 23:26:31 +0000 (UTC) (envelope-from kelly.terry.jones@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so1146436ana for ; Tue, 26 Dec 2006 15:26:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=PaHlsEXhgTPgAu4CxDstLsSbhLLE4W9oQGJBiE0xKoEUK0zm0sbVKhiL0oM8BdILqpSZ8X/Hu+hKcNpXTGpFcn1Wkhc4StikfY5d/uw2ECICrLRCiLEfZ1GAEePimRLbCPG6rd8xim0FrGojj15FeMpZdfFhiyrSoZjD0xUX5kY= Received: by 10.100.135.16 with SMTP id i16mr1364866and.1167175591012; Tue, 26 Dec 2006 15:26:31 -0800 (PST) Received: by 10.100.167.18 with HTTP; Tue, 26 Dec 2006 15:26:30 -0800 (PST) Message-ID: <26face530612261526r3954a4d6m972feba654b332b9@mail.gmail.com> Date: Tue, 26 Dec 2006 16:26:30 -0700 From: "Kelly Jones" To: freebsd-questions@freebsd.org, linuxusersgroup@googlegroups.com MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Unix/sh/bash/tcsh command to limit clock time for program? 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: Tue, 26 Dec 2006 23:26:31 -0000 Is there a Unix or shell command that runs a given program for n seconds and then terminates it (unless the program takes less than n seconds to run, obviously)? I know ulimit can limit a program's CPU time and sh's TIMEOUT variable can limit idle time at the shell prompt, but how to limit a program's clock time? There's an expect script that seems to do what I want (http://expect.nist.gov/example/timed-run), but is there something more basic and "built-in" to either sh/bash/tcsh or Unix? -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile.