[CentOS] time command

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Wed Apr 11 17:39:22 UTC 2007


On Wed, Apr 11, 2007 at 01:13:36PM -0400, Bisbal, Prentice wrote:
> > $ time (echo a ; echo b)
> > a
> > b
> > 
> > real    0m0.001s
> > user    0m0.000s
> > sys     0m0.001s
> 
> What shell are you using? That doesn't work for me using Centos 4.4. My
> original command was time (ls; ls). I just tried you example and that
> doesn't work, either. I'm using bash. 

3.1.17 works (FC6); 3.00.16 doesn't (CentOS 4.4).

But the following works in every shell I tested (those before and also
2.05b, CentOS 3.8):
time { echo a; echo b; }
a
b

real    0m0.000s
user    0m0.000s
sys     0m0.000s

Note that the following *has* to work everywhere, but also includes the
penalty of starting a new shell:
time sh -c 'echo a; echo b'

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20070411/0be6879f/attachment.sig>


More information about the CentOS mailing list