Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #11227

time builtin does not work with set -e when a command fails

Path csiph.com!aioe.org!news.glorb.com!usenet.stanford.edu!not-for-mail
From Sam Watkins <sam@nipl.net>
Newsgroups gnu.bash.bug
Subject time builtin does not work with set -e when a command fails
Date Fri, 17 Jul 2015 13:48:52 +1000 (AEST)
Lines 38
Approved bug-bash@gnu.org
Message-ID <mailman.7048.1437136393.904.bug-bash@gnu.org> (permalink)
NNTP-Posting-Host lists.gnu.org
X-Trace usenet.stanford.edu 1437136393 26810 208.118.235.17 (17 Jul 2015 12:33:13 GMT)
X-Complaints-To action@cs.stanford.edu
Cc sam@nipl.net
To bug-bash@gnu.org,bash@packages.debian.org
Envelope-to bug-bash@gnu.org
X-detected-operating-system by eggs.gnu.org: GNU/Linux 3.x
X-Received-From 111.118.174.25
X-Mailman-Approved-At Fri, 17 Jul 2015 08:33:11 -0400
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref aioe.org gnu.bash.bug:11227

Show key headers only | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib  -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall
uname output: Linux opal.nipl.net 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 37
Release Status: release

Description:
	The time builtin does not work with set -e when a command fails.
	The "time" builtin should give timing for a command regardless of exit status.

	Examples:

	# 1. with set -e, the time builtin is silent for failed commands (this is the bug)
	$ bash -ce 'time false'

	# 2. normally the time builtin gives times for failed commands
	$ bash -c 'time false'

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

	# 3. the time(1) utility gives times for failed commands with set -e, of course
	$ bash -ce 'command time false'
	Command exited with non-zero status 1
	0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1664maxresident)k
	0inputs+0outputs (0major+150minor)pagefaults 0swaps

Repeat-By:
	$ bash -ce 'time false'

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

time builtin does not work with set -e when a command fails Sam Watkins <sam@nipl.net> - 2015-07-17 13:48 +1000

csiph-web