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

Re: Bug or feature?



> It appears that the internal 'time' command doesn't like a 'for' loop
> yet other internal shell commands are acceptable.  Bug or feature?
> 
> [ rittle@supra ]; time for (i=1 2 3) echo hi
> syntax error
> [ rittle@supra ]; for (i=1 2 3) echo hi
> hi
> hi
> hi

Feature.  ``for'' is special syntax, where ``if'' is just a shell
function.  As a workaround, use

	time { for (i=1 2 3) echo hi }

--p