[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'time' doesn't time subshells that exec
From: |
Martijn Dekker |
Subject: |
'time' doesn't time subshells that exec |
Date: |
Sat, 9 Sep 2017 14:16:25 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
The 'time' reserved word seems to be unable to time subshells that run
'exec'. Is this intentional? (ksh93, mksh and zsh all do manage this.)
$ time (sleep 1)
real 0m1,003s
user 0m0,001s
sys 0m0,002s
$ time (exec sleep 1)
$ time (echo hi; exec sleep 1)
hi
$ echo "$BASH_VERSION"
4.4.12(3)-release
- Martijn
- 'time' doesn't time subshells that exec,
Martijn Dekker <=