From owner-freebsd-questions@freebsd.org Fri Apr 21 16:41:11 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 F2629D481DF for ; Fri, 21 Apr 2017 16:41:11 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay14.qsc.de (mailrelay14.qsc.de [212.99.163.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2658316FA for ; Fri, 21 Apr 2017 16:41:10 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay14.qsc.de; Fri, 21 Apr 2017 18:41:00 +0200 Received: from r56.edvax.de (port-92-195-67-137.dynamic.qsc.de [92.195.67.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id E11733CBF9; Fri, 21 Apr 2017 18:40:58 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v3LGevPO006291; Fri, 21 Apr 2017 18:40:58 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 21 Apr 2017 18:40:57 +0200 From: Polytropon To: Ernie Luzar Cc: FreeBSD questions Subject: Re: Problem with time command Message-Id: <20170421184057.395ee6a3.freebsd@edvax.de> In-Reply-To: <58FA33B8.70807@gmail.com> References: <58FA33B8.70807@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay14.qsc.de with 3525F683437 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.3763 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 16:41:12 -0000 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 ...] > 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. > 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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...