From owner-freebsd-questions@FreeBSD.ORG Fri Jul 27 12:55:20 2012 Return-Path: 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 9B0C9106566C for ; Fri, 27 Jul 2012 12:55:20 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 537B68FC0A for ; Fri, 27 Jul 2012 12:55:20 +0000 (UTC) Received: from mr16.lnh.mail.rcn.net ([207.172.157.36]) by smtp02.lnh.mail.rcn.net with ESMTP; 27 Jul 2012 08:55:19 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr16.lnh.mail.rcn.net (MOS 4.3.4-GA) with ESMTP id BWO18361; Fri, 27 Jul 2012 08:55:19 -0400 Received-SPF: None identity=pra; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="roberthuff@rcn.com"; x-conformance=sidf_compatible Received-SPF: Neutral identity=mailfrom; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="roberthuff@rcn.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None identity=helo; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="postmaster@jerusalem.litteratus.org.litteratus.org"; x-conformance=sidf_compatible Received: from 209-6-86-84.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([209.6.86.84]) by smtp01.lnh.mail.rcn.net with ESMTP; 27 Jul 2012 08:55:19 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20498.36790.654638.359301@jerusalem.litteratus.org> Date: Fri, 27 Jul 2012 08:55:18 -0400 To: Matthias Apitz In-Reply-To: <20120727123429.GA2094@tiny.Sisis.de> References: <20120727123429.GA2094@tiny.Sisis.de> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr16.lnh.mail.rcn.net) Cc: freebsd-questions@freebsd.org Subject: calculating difference of times 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: Fri, 27 Jul 2012 12:55:20 -0000 Matthias Apitz writes: > Do we have something (in the ports) to calculate easy the > difference of two times given as hh:mm - hh:mm? Some hack in > bc(1) or something like this? Well, I could translate the times > into UNIX seconds of epoche, build the diff and reconvert, but > something more easy (and not in Perl or C, just shell); thanks I don't know if there's something already available. (Sorry - never had this problem.) If the format is fixed, then parsing it with awk is trivial. After that, the math should be doable with "expr". Robert Huff