You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
koalaman edited this page Jan 26, 2016
·
1 revision
Quote this invalid brace expansion since it should be passed literally to eval
Problematic code:
evalecho {1..$n}
Correct code:
eval"echo {1..$n}"
Rationale:
Using eval somecommand {1..$n} depends both on bash silently failing to interpret the brace expansion, and on it passing failing brace expansions literally.
Rather than depending on these questionable features (which already behave differently in other shells), use the explicit, predictable way of passing values literally: quoting.