bug-bash
[Top][All Lists]
Advanced

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

Re: Odd bash behaviour with time:


From: Piotr Grzybowski
Subject: Re: Odd bash behaviour with time:
Date: Sat, 1 Nov 2014 01:19:24 +0100

Hi Jon,

 dedicated to you, (a bit trickier to find, since time is a static
shell builtin):

diff --git a/execute_cmd.c b/execute_cmd.c
index 9cebaef..47c6890 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -693,6 +693,10 @@ execute_command_internal (command, asynchronous, pipe_in, p
        }
       else
        {
+   if (command == NULL || (command->type == cm_simple && command->value.Simple-
+    printf("\nnecesitamos un pipeline\n");
+    return 1;
+   }
          exec_result = time_command (command, asynchronous, pipe_in, pipe_out,
 #if 0
          if (running_trap == 0)



On Sat, Nov 1, 2014 at 12:31 AM, jon <address@hidden> wrote:
> On Fri, 2014-10-31 at 15:56 -0700, Eduardo A. Bustamante López wrote:
>> >  well, help time clearly states how it should be used.
>> You are clearly not understanding the point.
>>
>> The point is: why does
>>
>>   time
>>
>> work, but
>>
>>   time ; somecommand
>>
>> doesn't.
>>
>> It's that simple. It's not a usage question, I'm very aware of how to
>> use time. Stop being condescending.
>
> Interesting interpreter question, but does "time" on its own have any
> meaning? - if not "time" with no arguments should generate an error
> rather than an output as it does currently.
>
>
> This is meaningful
> # time /bin/bash -c 'sleep 1' ;echo hello
>
> real    0m1.003s
> user    0m0.004s
> sys     0m0.000s
> hello
>
> This is not
> # time ;echo hello
> bash: syntax error near unexpected token `echo'
>
>



reply via email to

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