On 6/9/14, 8:51 PM, Dale R. Worley wrote:
> 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-unknown-linux-gnu' 
> -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' 
> -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g 
> -O2
> uname output: Linux hobgoblin.ariadne.com 3.14.4-100.fc19.x86_64 #1 SMP Tue 
> May 13 15:00:26 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-unknown-linux-gnu
> 
> Bash Version: 4.3
> Patch Level: 0
> Release Status: release
> 
> Description:
> 
> It appears that the reserved word 'time' is not recognized as such if
> it is the first word of the command following 'if'.  Instead,
> /usr/bin/time is executed, producing different output.

Thanks for the report.  There are several places where `time' should be
recognized as a reserved word where it currently is not.  Please try the
attached patch and verify that it does what you want.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3-patched/parse.y	2014-04-07 11:56:12.000000000 -0400
--- parse.y	2014-06-11 10:25:53.000000000 -0400
***************
*** 2789,2797 ****
      case OR_OR:
      case '&':
      case DO:
      case THEN:
      case ELSE:
      case '{':		/* } */
!     case '(':		/* ) */
      case BANG:		/* ! time pipeline */
      case TIME:		/* time time pipeline */
--- 2789,2802 ----
      case OR_OR:
      case '&':
+     case WHILE:
      case DO:
+     case UNTIL:
+     case IF:
      case THEN:
+     case ELIF:
      case ELSE:
      case '{':		/* } */
!     case '(':		/* )( */
!     case ')':		/* only valid in case statement */
      case BANG:		/* ! time pipeline */
      case TIME:		/* time time pipeline */

Reply via email to