Re: syntax error near unexpected token `time'

2014-12-15 Thread Andre Majorel
On 2014-12-14 21:12 -0500, Chet Ramey wrote:

> Yes, `time' should not be recognized as a reserved word in this case, even
> though the previous token is a newline.  I'll take a look at it.  Thanks
> for the report.

Note that the error occurs even if there is white space between
the newline and "time".

Thank you Chet, Eduardo and Piotr.

-- 
André Majorel http://www.teaser.fr/~amajorel/



Re: syntax error near unexpected token `time'

2014-12-14 Thread Chet Ramey
On 12/14/14 11:44 AM, Andre Majorel wrote:
> Funny one :
> 
>   $ bash -c 'echo a | time cat'
>   a
>   [/usr/bin/time output deleted]
> 
> On the other hand :
> 
>   $ bash -c 'echo a |
>   time cat'
>   bash: -c: line 1: syntax error near unexpected token `time'
>   bash: -c: line 1: `time cat'
>   [$PS2 deleted]

Yes, `time' should not be recognized as a reserved word in this case, even
though the previous token is a newline.  I'll take a look at it.  Thanks
for the report.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: syntax error near unexpected token `time'

2014-12-14 Thread Piotr Grzybowski
hi Andre,

 it has been worked on:

https://lists.gnu.org/archive/html/bug-bash/2014-11/msg00031.html
https://lists.gnu.org/archive/html/bug-bash/2014-11/msg3.html
https://lists.gnu.org/archive/html/bug-bash/2014-11/msg5.html

 cheers,
pg

On Sun, Dec 14, 2014 at 7:28 PM, Eduardo A. Bustamante López
 wrote:
> You might be interested in this thread:
> https://lists.gnu.org/archive/html/bug-bash/2014-10/msg00241.html
>
> The issue hasn't been worked on, but, this new thread seems like a 
> continuation
> of that old one :)
>



Re: syntax error near unexpected token `time'

2014-12-14 Thread Eduardo A . Bustamante López
You might be interested in this thread:
https://lists.gnu.org/archive/html/bug-bash/2014-10/msg00241.html

The issue hasn't been worked on, but, this new thread seems like a continuation
of that old one :)



syntax error near unexpected token `time'

2014-12-14 Thread Andre Majorel
Funny one :

  $ bash -c 'echo a | time cat'
  a
  [/usr/bin/time output deleted]

On the other hand :

  $ bash -c 'echo a |
  time cat'
  bash: -c: line 1: syntax error near unexpected token `time'
  bash: -c: line 1: `time cat'
  [$PS2 deleted]

Dash, ksh and zsh accept either form.

That was with Bash 4.2.37. If it's been fixed in a later
version, sorry for the noise.

-- 
André Majorel http://www.teaser.fr/~amajorel/