From owner-freebsd-questions@freebsd.org Fri Apr 21 20:08:51 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1999BD4971B for ; Fri, 21 Apr 2017 20:08:51 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3072828 for ; Fri, 21 Apr 2017 20:08:50 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id r16so127497088ioi.2 for ; Fri, 21 Apr 2017 13:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=Z88eNDTblL0XX0048TT9HhFhFRwB50F5oG7XcuY4rp0=; b=a4JffM39ZJY+WjtftoJf5uYiI+wLpOFLGWkzO7XxtiqXatgUQVxuRcYAXTMW7zShUU EPnVFA0JFxqPtFudhsHGnYMBNY6O86cXKHzLZmDSM9hHETqU89LzhTezj+nHqko7dKDl VwdsF4m3Q8bdxOW5bC7XqLyD3F5d7OfMHBGHre28J8CsIYKCtb4kul0Cbi2DMNSitTOc wG0LhbENWkkmGEGl2vBANLtwuLHElcXpo9/hOV4GjHl9mAdPg2DLVLpsfXy6VC5ofAYr udWPVWKRpMO2RDhpXRjb8Ry92jmO4JQdUKSWOW93dldEjCw4bUAKqQYH7TlJsSFE+0Ek 0WEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=Z88eNDTblL0XX0048TT9HhFhFRwB50F5oG7XcuY4rp0=; b=mV2sawxQEZshjws/DdYb+uiYEavFp0BBzu0J64wIgiebxQ9OTBIxR+V2tdFnavxdEO MU9vnVLdGX+41W3sb11q4UNSKsnhkL/teZNZ96+ezz1/BLMDg99qtgcQMuwcnChpBu9d 0LWpkrUSvZDLuImYMfa7RE2CfcV5Nl3BkoWcJXR+7V7vuDiBxqzeUDhXkNoF2keTgyWy C3ueMuruZdk5l08nPZHNv9xlmfcuChcwbLmWLnDuN3uhVUJzuejdgSNaKeAFFXoABIWB SBsW7aKHGWqllBpmTiT99CaaHiJPa058qHp7jV5PZAoybHS+ghJZGQR4cggxM9c3BEqX e0aw== X-Gm-Message-State: AN3rC/44t1/PcU6ehmMWYPBFxfHm5fS25OGVZMht9icMiRcLfi6Z67cK xZ1f1MnyBrDKjH+i X-Received: by 10.36.67.200 with SMTP id s191mr541365itb.78.1492805315081; Fri, 21 Apr 2017 13:08:35 -0700 (PDT) Received: from [10.0.10.3] (cpe-74-141-88-57.neo.res.rr.com. [74.141.88.57]) by smtp.googlemail.com with ESMTPSA id y124sm1154561itd.19.2017.04.21.13.08.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Apr 2017 13:08:34 -0700 (PDT) Message-ID: <58FA66D6.1040304@gmail.com> Date: Fri, 21 Apr 2017 16:08:54 -0400 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Polytropon CC: FreeBSD questions Subject: Re: Problem with time command References: <58FA33B8.70807@gmail.com> <20170421184057.395ee6a3.freebsd@edvax.de> In-Reply-To: <20170421184057.395ee6a3.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 20:08:51 -0000 Polytropon wrote: > On Fri, 21 Apr 2017 12:30:48 -0400, Ernie Luzar wrote: >> Hello list; >> >> Was testing the time command. These problems came to light. >> >> >> time [-al] [-h | -p ] utility-name > > That somehow doesn't look like "man 1 time". The synopsis > should be: > > SYNOPSIS > time [-al] [-h | -p] [-o file] utility [argument ...] > > Ok yes I shorten it for the post >> issuing time -h custom.refresh >> results in error message -h: Command not found >> >> issuing time -p custom.refresh >> results in error message -p: Command not found > > I assume you're running this command interactively from within the > C shell, right? In this case, use /usr/bin/time to use the actual > "time" binary. If you don't, the C shell's built-in time command > will be used. > > > No I issued "time -h" "time -p" from the console command line. "custom.refresh" is a sh script. I just tried "time date" from the command line and get the same results as posted above. >> The DESCRIPTION says, >> The time utility executes and times the specified utility. After the >> utility finishes, time writes to the standard error stream, (in >> seconds): the total time elapsed, the time used to execute the utility >> process and the time consumed by system overhead. >> >> issuing time custom.refresh >> results in this output >> 0.089u 0.469s 0:01.44 37.5% 32+181k 64+137io 709pf+0w > > That proves you're using the C shell's internal time command, not > the binary. It would have an output format like this: > > % /usr/bin/time ls > 0.00s real 0.00s user 0.00s sys > > When you use the "time" command _inside_ your script, the binary > will be used because sh (the script's interpreter) doesn't have > a built-in time command. > > >