Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2002 16:39:56 -0500 (EST)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: time usage question
Message-ID:  <Pine.SOL.4.21.0202061638070.10466-100000@opal>
In-Reply-To: <20020206213251.GJ1066@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Thanks. I have found a workaround (tell me if I am wrong):

$ cat mycommand
ls | xargs rm

$ time mycommand

-Zhihui

On Wed, 6 Feb 2002, Dan Nelson wrote:

> In the last episode (Feb 06), Zhihui Zhang said:
> > 
> > I often use something like:
> > 
> > $ time command
> > 
> > Now the command is a complex one, like "ls | xargs rm".  Can I still use
> > the same format.  For example,
> > 
> > $ time ls | xargs rm
> 
> Depends on your shell.  zsh will time each command in the pipeline
> separately:
> 
> zsh> time ls | wc -l | wc -l
>        1
> ls  0.00s user 0.04s system 54% cpu 0.071 total
> wc -l  0.00s user 0.02s system 26% cpu 0.059 total
> wc -l  0.00s user 0.01s system 14% cpu 0.053 total
> 
> Most other shells will time only the first command.
> 
> -- 
> 	Dan Nelson
> 	dnelson@allantgroup.com
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0202061638070.10466-100000>