I read about commands within the { }, happen in the current shell without start a new so The following commands:
for i in {1..50000} ; do echo $i ; done
should works the same as
for i in {1..50000} ; { do echo $i } ; done
but it gives me an error:
zsh: parse error neardo’`
any idea?
I think you mixed-up (and made a typo) two concepts.
The documentation http://www.gnu.org/software/bash/manual/bashref.html
in section 3.2.4.3 says:
They explain it is different from
(list; )with parenthesis (not braces) that would invoke a subshell.Further in the doc, in 3.5.1, they explain braces expansion (the brace content is expanded as a list of values).
Actually:
is a brace expansion: the content between the braces is replaced by a list of integer.
What you wanted to do after the for command, should write:
Notes:
1/ { MUST be followed by a space.
2/ the do command should not be in the brace
3/ the list of commands must end with a semicolon ;