bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

`time ( someCmd )` Doesn't Print Time Under 5.2


From: dabe
Subject: `time ( someCmd )` Doesn't Print Time Under 5.2
Date: Mon, 21 Nov 2022 19:07:08 -0500 (EST)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin22.1.0
Compiler: clang
Compilation CFLAGS: -DSSH_SOURCE_BASHRC
uname output: Darwin triton.parabon.com 22.1.0 Darwin Kernel Version 22.1.0: 
Sun Oct  9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin22.1.0

Bash Version: 5.2
Patch Level: 9
Release Status: release

Description:
        Under 5.2.x, measuring the `time` of a subshell -- `time ( sleep 1 )` 
for example -- doesn't display any timing information,
        whereas `5.1.x` and before did.

        Builtins work[*] but if "someCmd" includes an external program, bupkis:

          bash-5.2% time ( sleep 1 )              # No timing output

          bash-5.2% time ( sleep 1 </dev/null )   # Okay
          bash-5.2% time ( sleep 1 >/dev/null )   # Okay
          bash-5.2% time ( sleep 1 ) </dev/null   # No timing output
          bash-5.2% time ( sleep 1 ) >/dev/null   # No timing output
          bash-5.2% time ( sleep 1 ) | cat        # Okay
          bash-5.2% time ( sleep 1 ) > >(cat)     # No timing output

          bash-5.2% time ( exec 2>/dev/null; : )  # Builtin(s), but no timing 
output (/dev/fd/2 leaks?)

          bash-5.2% time ( echo Hi )              # Okay (Builtin)
          bash-5.2% time ( exec echo Hi )         # No timing output
          bash-5.2% time ( eval echo Hi )         # Okay
          bash-5.2% time ( eval sleep 1 )         # Okay (...!)
          bash-5.2% time ( eval exec echo Hi )    # No timing output

          bash-5.2% time ( { sleep 1; } )         # Okay, FWIW
          bash-5.2% time { ( sleep 1 ); }         # Okay, FWIW

        emanuele6 suspects it has to do with 
https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00107.html

        Also:

          <emanuele6> i tried to run this script bash 5.2 with little memory
          <emanuele6> .source_code/bash/bash -c 'ulimit -v 5000; for (( x = 0; 
i < 2000000; ++i )); do echo "$i"; time (:); done'
          <emanuele6> it fails after 20 calls with OOM
          <emanuele6> and in bash 5.1, that code runs without problems



reply via email to

[Prev in Thread] Current Thread [Next in Thread]