Project

General

Profile

Actions

Bug #7694

closed

ksh -e continues to execute failed scripts when 'time' built-in is involved

Added by Alexander Pyhalov over 5 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2016-12-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Reproducer:

$ cat 1.sh
#!/bin/sh
time false
echo $?
true
$ /usr/bin/ksh93 -e  1.sh && echo ok

real    0m0.00s
user    0m0.00s
sys     0m0.00s
1
ok

$ bash -e  1.sh && echo ok
# no output

If I change time to /bin/time, it behaves as expected:
$ cat 1.sh 
#!/bin/sh
/bin/time false
echo $?
true
$ /usr/bin/ksh93 -e  1.sh  && echo 1

real        0.0
user        0.0
sys         0.0
$ /usr/bin/bash -e  1.sh  && echo 1

real        0.0
user        0.0
sys         0.0

Actions

Also available in: Atom PDF